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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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