Consulting

Results 1 to 8 of 8

Thread: Sleeper: Ctr + Z after running macro

  1. #1

    Lightbulb Sleeper: Ctr + Z after running macro

    Is it posiible to undo action of any macro

    i have seen that if any vba code is run then one can not undo if it is by mistake
    any help to undo action of macro.
    A mighty flame followeth a tiny sparkle!!



  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by excelliot
    Is it posiible to undo action of any macro

    i have seen that if any vba code is run then one can not undo if it is by mistake any help to undo action of macro.
    Unfortunately, many macro commands clear the undo stack, so it is lost.

    If you need this sort of functionality in your code, you have to do it yourself, know what could chan ge, save the 'before' changes, etc.

    John Walkenbach covers it at http://www.j-walk.com/ss/excel/tips/tip23.htm

  3. #3
    Quote Originally Posted by xld
    Unfortunately, many macro commands clear the undo stack, so it is lost.

    If you need this sort of functionality in your code, you have to do it yourself, know what could chan ge, save the 'before' changes, etc.

    John Walkenbach covers it at http://www.j-walk.com/ss/excel/tips/tip23.htm
    I copied & run macro but it gave follo error

    Compile error
    Can not define a public user defined type within an object module

    i m running on windows 98, office 98

    any help on it
    A mighty flame followeth a tiny sparkle!!



  4. #4
    VBAX Mentor Justinlabenne's Avatar
    Joined
    Jul 2004
    Location
    Clyde, Ohio
    Posts
    408
    Location
    It needs to go in a Standard Module.

    By the way, is Office 98 Excel 97 or Excel 2000? I have never heard of Office 98 or Excel 98, see here. Versions
    Justin Labenne

  5. #5
    Moderator VBAX Mentor sheeeng's Avatar
    Joined
    May 2005
    Location
    Kuala Lumpur
    Posts
    392
    Location
    Quote Originally Posted by Justinlabenne
    It needs to go in a Standard Module.

    By the way, is Office 98 Excel 97 or Excel 2000? I have never heard of Office 98 or Excel 98, see here. Versions
    I think office 98 is what he meant on is office 97.
    ...small mistake...
    no big problem here....

  6. #6
    Quote Originally Posted by sheeeng
    I think office 98 is what he meant on is office 97.
    ...small mistake...
    no big problem here....
    Atlest somebody has same wavelenghth of mine
    A mighty flame followeth a tiny sparkle!!



  7. #7
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    That's good to know, I believe Excel 98 is Mac (yes, there is an Excel 98).

  8. #8
    VBAX Mentor Justinlabenne's Avatar
    Joined
    Jul 2004
    Location
    Clyde, Ohio
    Posts
    408
    Location
    Uh, I am on the wavelength, but since you said 98, it threw me, you could get an error becuase the code may not work in Excel 97, you (as Zack pointed out) could be using a mac and actually have Excel 98, or you could have made a mistake and put 98 instead of 97, been using windows 98 with office 2000, and put 98 for both, I just don't know.

    I was curious as to where your problem with the code came from, and was trying to find out if it was version incompatability, code was in the wrong module, or something else.

    So, hopefully you got the code to run no matter which version of Excel you have or if it's on a pc or a mac.
    Justin Labenne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •