+ Reply to Thread
Results 1 to 9 of 9

Call a Macro if ANYTHING on a worksheet changes

  1. #1
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Unhappy Call a Macro if ANYTHING on a worksheet changes

    Hi guys,

    There are TONS of resources available from our friend "Google"... But I can't seem to get my macro to run.

    • I've got a macro in a module Sub T_SETUP().
    • When anything in a worksheet calls "DESIGN" changes, (users will be picking from dropdown boxes), the above macro should be called and run.

    I've tested the T_SETUP code by stepping through, and it runs fine, but whe I add the below code (and several variations of it), I can't get anything (not even an error) to appear...

    In Sheet7 (DESIGN), I've added variations of :
    Please Login or Register  to view this content.
    I hope someone can point me in the right direction :-)
    Last edited by Darth269; 02-26-2014 at 01:32 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Call a Macro if ANYTHING on a worksheet changes

    The use of a drop down list to make a selection does activate a Worksheet_Change event.

    At this point the only way for us to help is to see a sample version of your workbook so we can test your macros directly.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Call a Macro if ANYTHING on a worksheet changes

    Darn, I was hoping that I wouldn't be asked that, as I cannot upload this Workbook. Is there any sample codes, other posts or tutorial sites that may provide me with guidiance?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Call a Macro if ANYTHING on a worksheet changes

    That's why I said "Sample version". You can certainly upload the workbook after all the sensitive data has been replaced by garbage. Just make sure the macro works on the garbage data, too.

  5. #5
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Call a Macro if ANYTHING on a worksheet changes

    Thank you for your time, but the workbook has Tons of data all linking between sheets. I'll find another way around it.

    Cheers though,

    Tim

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Call a Macro if ANYTHING on a worksheet changes

    If you still want help and don't want to upload to a public site, you can contact me through my site below and perhaps I can look at it through a direct email. Cheers.

  7. #7
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Call a Macro if ANYTHING on a worksheet changes

    OK, anyone who's interested... I got home this morning (I work nights in the UK), and opened it up to take another crack, and low and behold... it ran....

    I had to change :-
    Please Login or Register  to view this content.
    To this....

    I had to change :-
    Please Login or Register  to view this content.
    But it runs. Which is the main thing. The only difference between work and here, is the excel version. I'm running 2010 at work, and 2013 here.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Call a Macro if ANYTHING on a worksheet changes

    Excellent. Thanks for the result. Offhand I never use anything except "Call" for sub routines, your "Run" syntax looked trustworthy. Good stuff.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: Call a Macro if ANYTHING on a worksheet changes

    I would expect to see Application.Run rather than just Run. And, more often than not, you can run another macro in the same workbook just by using it's name; no Run or Call.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Call a sub or function from another worksheet sub
    By srinivassurapareddi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2012, 09:08 AM
  2. How can I call worksheet as function from another worksheet?
    By CheEngineeer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2007, 12:15 PM
  3. Define worksheet as variable, then call in macro
    By bugman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2005, 01:20 PM
  4. [SOLVED] call a macro in another worksheet?
    By George Conard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2005, 04:06 PM

Tags for this Thread

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