RENAME CHANGING SHEET NAME

CJ

Board Regular
Joined
Feb 22, 2002
Messages
77
Hi,
I'm trying to rename a sheet, after importing a text file which will always
have a different name, i.e COD 20051105, COD 20051106 Etc.
The sheeet name by default will inherit the file name, COD 20051105

I need to rename the sheet no matter what the name is, i've searched
and found this but it's dependant on a value all ready on the sheet
Can any one adapt this code to help me accomplish this task

Sub RenameSheet()
ActiveSheet.Name = ActiveSheet.Range("A2").Value
End Sub

Chris
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What do you want to change the name to?

If just a hard-coded, name simply use something like:
Code:
Sub RenameSheet() 
   ActiveSheet.Name = "MyNewName"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,176
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top