+ Reply to Thread
Results 1 to 4 of 4

Make macro run when some other Sheet is active

  1. #1
    Registered User
    Join Date
    08-20-2016
    Location
    Belgrade
    MS-Off Ver
    Windows 7 64-bit, Excel 2007
    Posts
    22

    Make macro run when some other Sheet is active

    Hello.

    I'm using the following macro which allows me to copy some values under certain conditions on Sheet1.

    Since I'm also using Application.OnTime my macro runs on every 30 seconds.

    However, when I open some other Sheet on the same Workbook (that "other" Sheet becomes active) macro simply stops counting and nothing happens in Sheet1...

    I would like my macro to run (in this case data are on Sheet1) no matter which Sheet or Workbook I open (is active).

    Any idea how to solve this?

    Here is the code:

    Please Login or Register  to view this content.

  2. #2
    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
    38,852

    Re: Make macro run when some other Sheet is active

    Please Login or Register  to view this content.
    Note all the dots
    Trevor Shuttleworth - Excel Aid

    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


  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Make macro run when some other Sheet is active

    Qualify all references to a range with the workbook/worksheet.

    Please Login or Register  to view this content.

  4. #4
    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
    38,852

    Re: Make macro run when some other Sheet is active

    Thanks for the rep.

+ 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: Copy Active Sheet, Make Values Only, then Save Copy
    By brendangroff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2015, 04:34 PM
  2. make a sort by active sheet, not specific sheet
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2014, 11:25 AM
  3. Make a macro run on only a specified worksheet regardless of which sheet is active.
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-18-2014, 12:18 PM
  4. Macro to go back to the last active sheet and hide the active sheet
    By yatahaze in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2014, 08:18 AM
  5. Make this macro select active sheet
    By smugglersblues in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2013, 07:18 PM
  6. Macro to Print active sheet as PDF to Active workbook and customize name
    By Scott Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2012, 08:52 PM
  7. [SOLVED] macro to find cell content in sheets and make sheet active
    By Nigel in forum Excel General
    Replies: 3
    Last Post: 11-18-2005, 05:00 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