Copy Active sheet & rename using part of Active sheet name

Barb Mick

New Member
Joined
Jan 25, 2018
Messages
14
Office Version
  1. 365
I'm trying to find code to make a copy of the active sheet and rename the copy using part of the Active sheet name. For example if the Active sheet is named "Expenses" then I want the copy to be named "Expenses - West".

Can anyone help?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this:

Code:
Sub Copy_Active_Sheet()
'Modified 1/29/2019 11:22:16 PM  EST
Dim OldName  As String
Dim NewName As String
OldName = ActiveSheet.Name
NewName = OldName & "-West"
Sheets(OldName).Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = NewName
End Sub
 
Upvote 0
This works beautifully, thank you!!!
One more question...
How can I insert the copy directly one tab right of the old sheet rather than at the end of the workbook?
 
Upvote 0
Try this:
Code:
Sub Copy_Active_Sheet()
'Modified  1/31/2019  9:54:43 AM  EST
Dim OldName  As String
Dim NewName As String
OldName = ActiveSheet.Name
NewName = OldName & "-West"
Sheets(OldName).Copy After:=Sheets(OldName)
ActiveSheet.Name = NewName
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,273
Members
448,559
Latest member
MrPJ_Harper

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