copy/paste sheet into same workbook

austin350s10

Active Member
Joined
Jul 30, 2010
Messages
321
How do I take one worksheet lets call it "Test1" copy it and paste it into the same workbook with a new name "Test1 - (todays date)"?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Something like this? Test this with a copy of your file before you use it.


Sub CopySheetMacro()
'
' CopySheetMacro Macro
'
'
Sheets("Test1").Select
Sheets("Test1").Copy Before:=Sheets(1)
Sheets("Test1 (2)").Name = "Test1 - " & Format(Date, "mmm dd yy")
End Sub
 
Last edited:
Upvote 0
Thats kinda what I was thinking but it makes current sheet use the new name format instead of the copied sheet.

I am trying to make it do this:

(fresh workbook sheets in order)

Test1, other1, other2

(run macro once sheet order)
Test1, Test1 - (date), other1, other2

(run macro again)
Test 1, Test1 - (date), Test1 -(date), other1, other2

......

Test 1 should always stay visible though

is there anyway to do something like this?
 
Upvote 0
Possibly

Code:
Sheets("Test1").Copy after:=Sheets(Worksheets.Count)
Activeworkbook.saveas filename:-= Format(Date, "yyyy-mm-d") & ".xls"
 
Last edited:
Upvote 0
What if I want to use a date from a cell on the same sheet the macro is being called from. I took a crack a the code below but on luck.

What am i doing wrong?


Code:
Dim assessmentDate As Date

assessmentDate = Range("L81").Value

Sheets("Needs Assessment").Copy after:=Sheets(1)
ActiveSheet.Name = "Initial Assessment - " & assessmentDate
Sheets("Needs Assessment").Select
 
Upvote 0
Nevermind this works great:


Code:
Sheets("Needs Assessment").Copy after:=Sheets(1)
ActiveSheet.Name = "Initial Assessment - " & Format(Range("L81"), "mm-dd-yyyy")
Sheets("Needs Assessment").Select
 
Upvote 0

Forum statistics

Threads
1,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

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