macro changing with sheet name

  • Thread starter Thread starter Lane
  • Start date Start date
L

Lane

I have a macro that uses a specific sheet name, but I am using a module
to changes the name of that sheet tab to the current date each day. Is
there a way that I can have that macro adjust for that name chang
daily?

Thanks and Happy Holidays
 
Use the worksheet's "code name" rather than the name on the tab. Find the
code name in the Project window in the VBE. By default it will be something
like "SheetX".

So instead of:

Worksheets("OldName").Name = "NewName"

do this:

Sheet1.Name = "NewName"

If you want to change the code name use the Properties window. It's the
first property listed and can be edited right there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top