rename active sheet without specifiying name

y2k

Board Regular
Joined
Feb 25, 2002
Messages
133
is it possible to write some VBA that will just rename the active sheet? I've tried
Code:
    Sheets(ActiveSheet).Name = "my_new_name"
but that didn't work. I'm sure this is possible, I just don't use VBA that often, so what I do learn, I end up forgetting!!! :oops:

Thanks in advance
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I knew it would be easy, thanks!!!!!

Much apprecaited

Regards
Martin
 
Upvote 0
Andrew I have a very similar question..
When the code below copies to the destination folder the hyperlinks seem to be gone.. I need it to copy those also.

On Error Resume Next
Kill "H:\All\Material Prep Archive\(Public)Archive.xls"
On Error GoTo 0
On Error Resume Next
FileCopy Source:="H:\Burney Table\CUTTING FORMS (Protected by QC)\Archive\Master Archive.xls", Destination:= _
'"H:\All\Material Prep Archive\(Public)Archive.xls"
 
Upvote 0
Andrew I have a very similar question..
When the code below copies to the destination folder the hyperlinks seem to be gone.. I need it to copy those also.

How in the world is this similar to the original post?

I think you should make a new thread for this
 
Upvote 0
I realize this is an extremely old thread. But I'm trying to rename my sheet but a button click. The sheet name is a concat of string and range components. I keep getting a 1004 error - application-defined or object-defined error. For the life of me, I can't figure this one out.

Code:
Private Sub updateWorksheetName_Click()

   ActiveSheet.Name = "Flight " & ActiveSheet.Range("FlightNumber") & " - Check Number " & ActiveSheet.Range("PerformancCheckNumber")
   worksheetName.Caption = ActiveSheet.Name
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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