Consulting

Results 1 to 4 of 4

Thread: Macro Button

  1. #1
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location

    Macro Button

    Can anyone advise why when I click on the macros button that the name of the first macro in the list becomes the active cell?
    In other words, my first macro in the list is Add204. When I click the macros button, cell "ADD204" will activate on the active sheet. Very annoying.



    Excel 2010
    Windows 7

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Because ADD204 is a cell in Excel 2007->, so it jumps to it. You should never use a cell refernce as a defined name or a macro, use Add_204 or such.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location
    I did rename it to that. I was just curious. Seems to me that shouldn't happen.

    thanks
    gary

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Quote Originally Posted by zoom38 View Post
    Seems to me that shouldn't happen.
    Excel requires the User to be a little disciplined in how they intend to use the program whether at the Object level or within the programming level. Just like A1 is a cell reference so too is ADD204, so as Bob kindly suggested simply use an underscore to differentiate the Macro name from any potential cell reference.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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