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.
|