+ Reply to Thread
Results 1 to 2 of 2

Macro with activesheet reference stops working when worksheet is renamed

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    61

    Macro with activesheet reference stops working when worksheet is renamed

    hi guys,

    I am here after a while. Hope all's well around the world.

    I have been trying to get a macro with an activesheet reference to work dyanamically when the tab is renamed. However, it stops working whenever I access the VBA window as well as when i rename the tab. It is a live clock that updates the time by seconds. I need this in my worksheet to ensure another custom function works without the need for manual updating. I have the sample attached below. Also the macro with the clock doesnt automatically run when I open the workbook.

    it becomes much clearer when you reference the sample file.

    Can any geniuses out there please help me with this?

    Thanks in advance!

    Cheers,
    Naz
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro with activesheet reference stops working when worksheet is renamed

    Use a macro to prompt you for a new sheet name and then it renames the sheet without halting the clock code.

    Please Login or Register  to view this content.


    If you want the clock to autostart when the workbook is opened, put this code in the ThisWorkbook code module.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Excel crashes / stops working properly after deleting a worksheet
    By Pedsdude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2014, 05:11 AM
  2. Data Validation Macro stops working when worksheet is protected
    By keeferino in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-06-2014, 02:28 PM
  3. [SOLVED] Formula stops working when number is replaced with reference to cell containing same #
    By sskgintl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-21-2013, 12:44 PM
  4. [SOLVED] Macro stops working when I go to a different worksheet
    By gandrea in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-31-2012, 01:40 PM
  5. Writing Code to reference a newly renamed worksheet
    By sportsranker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2008, 02:24 PM
  6. Macro reference change when worksheet renamed ???
    By Southernw2002 in forum Excel General
    Replies: 5
    Last Post: 11-12-2007, 07:24 AM
  7. [SOLVED] Macro working in background ie not on activesheet
    By Dynamiteskippy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2005, 11: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