View Single Post
 
Old 08-04-2012, 06:12 AM
Chayes Chayes is offline Windows XP Office 2003
Advanced Beginner
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default Variable to rename a tab in a worksheet via VBA

Hi

I'm trying to rename a worksheet tab via VBA.

My problem is that the tab has a changing name.

EG
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "File 1"

"Sheet1" in this case will change in name next time I want to run the macro , so it will fail.

How can I build in a variable for the sheet selection so I can always rename it 'File 1' , whatever it used to be. It's always and only the first sheet I'm applying this to , by the way.

Grateful for any help.
Reply With Quote