+ Reply to Thread
Results 1 to 3 of 3

Troube with macros

  1. #1
    Registered User
    Join Date
    10-23-2006
    Posts
    13

    Troube with macros

    Hi there, I recently had to do a series of excercises building macros. I have very little experience in macros before and learned to dislike them because most of the time they do not work or they corrupt some other function of the Sheet. I must be doing something fundamentally wrong for this to happen or that's the way macros are. I follow the "record macro" steps and everything seems easy for a simple macro but they just do not work as expected. I get errors and "can't run macros" messages especially if the file has been saved under a new name, from a template to another template for instance. My question is that are macros generally a domain or programmers because they are so temperamentical and tricky that "normal living beings" should not mess with them?

    Hannu

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    It just takes a little experience, if you want, you can learn VBA with practice and by reading some of the threads in this forum.

    Macros record exactly what you do, so that means when you think "turn the last cell in this table blue" the macro actually records "turn cell X9 on sheetxyz blue". If you rearrange your data, or rename your sheets or workbooks, the macro gets lost.

    If you have some macros which are particularly useful although not too tricky, bring them to the board and ask for help making them more robust.

    Oh, and btw, about half of my programming time is spent either fixing bugs, or on a good day, fixing macros so the bugs won't appear to start with. Almost always I find them worth the investment.

    CC

  3. #3
    Registered User
    Join Date
    10-23-2006
    Posts
    13
    Quote Originally Posted by Cheeky Charlie View Post

    If you rearrange your data, or rename your sheets or workbooks, the macro gets lost.


    Oh, and btw, about half of my programming time is spent either fixing bugs, or on a good day, fixing macros so the bugs won't appear to start with. Almost always I find them worth the investment.

    CC

    Thank you CC, that was the most useful sentence about macros I have learned, no wonder i could not maintain the macros in templates as saving templates you have to rename the file. Crikey! why don't any literature say that. So macros and templates do not mix! I use Excel for many things but normally use formulas for getting things done and they do not change if data is changed or the filename is changed so macros do not follow the normal Excel robust principles.

    Hannu

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1