LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro renaming tab

Sheets("current").Activate
ActiveSheet.Name = Range("A24").Value
Sheets("current (2)").Name = "current"

"brandyvine" wrote:

Hi, I'm pretty new at macros, but I've written one that always has a
"current" tab. the current tab is copied and some changes are made to it and
the macro goes back to the current tab and copies the date range in a
specific cell on the worksheet to rename the tab with that cell's info. It
then goes to "current (2)" and renames it to "current". Problem is the macro
doesn't reference the cell info dynamically, instead it took the actual dates
and hard coded them into the macro. So when I go to run it the next week it
can't rename the new tab the same name as an existing tab (since it isn't
taking the new data from the new "current" sheet, its trying to name it the
hard coded info which has already been used to name a previous weeks tab.)
Here is the code as it exists. I tried changing it to reference the cell
directly but it just skipped over it and did not rename it at all.

Sheets("current").Select
ActiveWindow.SmallScroll Down:=-21
Range("A24").Select
Selection.Copy
Sheets("current").Select
Sheets("current").Name = "10-22-07 thru 11-04-07"
Sheets("current (2)").Select
Sheets("current (2)").Name = "current"

Thanks for any insight you can offer to help solve this issue.
--
b

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming Tabs in a Macro Liz C Excel Discussion (Misc queries) 3 October 30th 08 04:29 PM
Renaming a button using a macro fullers Excel Programming 2 February 21st 06 10:35 AM
Renaming a Macro Excel User Excel Programming 1 January 31st 06 07:07 PM
Renaming a Worksheet with a macro... but... Pitbull at Work Excel Programming 1 August 20th 04 07:09 PM
renaming worksheet from within macro Mark w Excel Programming 2 May 17th 04 03:41 AM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"