Duplicate Existing Worksheet and Name Tab

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
I am trying to to take a formatted worksheet called Blank which sits on the far left side and copy it to the far right side (next to the last working sheet) and change cell D1 to reflect seven days more than the last sheet i.e. Jul 25 would now becom Aug 1 etc.

Each tab is named the month and day using "mmm d" which is sitting as a formula in Cell H1 named Tab_Name =CONCATENATE(TEXT(D1,"mmm")," ",TEXT(D1,"d")) so would like to have the tab named using that format.

Any help would be greatly appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try

Code:
Sub CopySheet()
Sheets("Blank").Copy after:=Sheets(Sheets.Count)
Range("D1").Value = Range("D1").Value + 7
ActiveSheet.Name = Range("H1").Text
End Sub
 
Upvote 0
Hello Vog,

Thanks very much. Can you help with one last part of the entry. When your code runs can it put the new date in Cell D1 of the new sheet as that cell feeds other cells in the new worksheet.
 
Upvote 0
The line in red does that

Rich (BB code):
Sub CopySheet()
Sheets("Blank").Copy after:=Sheets(Sheets.Count)
Range("D1").Value = Range("D1").Value + 7
ActiveSheet.Name = Range("H1").Text
End Sub

I just tested to make sure that it does.
 
Upvote 0
For me it doesn't write anything to the Blank sheet. Maybe this (also tested and working)

Code:
Sub CopySheet()
Sheets("Blank").Copy after:=Sheets(Sheets.Count)
With Sheets(Sheets.Count)
    .Range("D1").Value = Range("D1").Value + 7
    .Name = Range("H1").Text
End With
End Sub
 
Upvote 0
Hello VoG,

Sorry for the confusion. If the last worksheet is Jul 25 on the tab and July 25, 2011 in cell D1 of the same sheet I need the new worksheet to reflect seven days ahead i.e. Aug 1 in the tab and August 1, 2011 in cell D1 of the new worksheet and the dates always controlled by the newest worksheet. Would I need to enter somehting in the Blank worksheet?
 
Upvote 0
Sorry, now I understand

Code:
Sub CopySheet()
Sheets("Blank").Copy after:=Sheets(Sheets.Count)
With Sheets(Sheets.Count)
    .Range("D1").Value = .Previous.Range("D1").Value + 7
    .Name = Range("H1").Text
End With
End Sub
 
Upvote 0
The date in cell D1 the new worksheet works fine. But the cell name is coming from the Blank worksheet instead of cell D1 of the new worksheet. Sorry for the trouble.
 
Upvote 0
Try

Code:
Sub CopySheet()
Sheets("Blank").Copy after:=Sheets(Sheets.Count)
With Sheets(Sheets.Count)
    .Range("D1").Value = .Previous.Range("D1").Value + 7
    .Name = Format(Range("D1").Value, "mmm d")
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

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