+ Reply to Thread
Results 1 to 5 of 5

Trying to update comment in multiple locations and sheets from one macro

  1. #1
    Registered User
    Join Date
    02-26-2015
    Location
    Lawton, OK
    MS-Off Ver
    MS Office 2010
    Posts
    12

    Trying to update comment in multiple locations and sheets from one macro

    I have a workbook that I use to pull data from another server that displays data in a color coded "map" of sorts. It does this through comments using dates and times. I have worked it out so that I can pull together everything I need from each sheet individually, and it all works fine for me, but I get complaints from others that they wish it could be simpler. Is there a way that I can run the macro for three of the five sheets at once? I have tried a few things that I have seen through several other threads, but everything just reloads the active sheet.

    This is how I run the query.

    Please Login or Register  to view this content.
    I have tried adding in "For Each sh In Worksheets" and "Next sh" in where I thought appropriate, and this re-ran the macro three times in the active sheet.

    Any help is much appreciated.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Trying to update comment in multiple locations and sheets from one macro

    You need to alter the code so activesheet is replace with relevant sheet reference.
    So something like this

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-26-2015
    Location
    Lawton, OK
    MS-Off Ver
    MS Office 2010
    Posts
    12

    Re: Trying to update comment in multiple locations and sheets from one macro

    I adjusted as follows:

    Please Login or Register  to view this content.
    This allows for the pull to happen one time in the sheet that I am currently in, but does not follow into the other two sheets. This fixes the problem that I have had with previous attempts of it running multiple times in one sheet, though, so that is progress. lol

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Trying to update comment in multiple locations and sheets from one macro

    If the routine EQCExecuteAllCommands works on the active sheet then you missed out the ws. infront of the Range("A2").activate

  5. #5
    Registered User
    Join Date
    02-26-2015
    Location
    Lawton, OK
    MS-Off Ver
    MS Office 2010
    Posts
    12

    Re: Trying to update comment in multiple locations and sheets from one macro

    Interesting fix. You are correct on the missing ws. in front of the Range("A2").activate. Oddly, this put me back to running the EQC routine three times on the same sheet, though. I am not sure why, but to fix this I have moved this routine to it's own Sub. It is dirty, but since it would not follow the same path as the comment routine, I am calling each page individually and running the EQC routine from each page. This could be because of a conflict inside the routine itself, maybe? Since it is proprietary and locked up I cannot look at it myself, so I am not going to fret too much. It is working the way, I believe, everyone wants it to work.

    I appreciate your time and effort helping me out on this.

+ 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. Macro to update multiple Chart Sheets Y-Axis
    By zman88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2017, 07:38 AM
  2. Replies: 3
    Last Post: 08-19-2016, 03:29 PM
  3. Macro to find and update information across multiple sheets and multiple workbooks
    By maxhecht2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2016, 11:35 AM
  4. I need to write a macro or procedure to update multiple sheets
    By martinhardy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2013, 05:29 AM
  5. See comment locations in worksheet
    By Lewis Koh in forum Excel General
    Replies: 3
    Last Post: 04-25-2010, 09:40 PM
  6. Info update between sheets with multiple variables Macro or VLOOKUP Maybe?
    By garretonufer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2009, 11:29 AM
  7. [SOLVED] Update multiple locations when changing a value on one worksheet
    By Monique in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2005, 08:05 PM

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