Hello,
I'm working on a timesheet. I would like to add a button that copies the activesheet and renames it based on cell I6 plus one day in mm dd yyyy format. Also, I would like the formulas in the newly created worksheet to reference the previous worksheet (one just copied) and lastly, I would like the tab with the current payperiod highlighted.
I have found the following but I don't know how tweak them to make them work for me.
Sub NewMonth()
ActiveSheet.Copy After:=Sheets(Sheets.Count)
With ActiveSheet
.Name = Format(Range("I6").Value, "mm DD yyyy")
.Range("I6").Copy
.Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
End Sub
and:
Dim ws As Worksheet
Set ws = Worksheets(Worksheets.Count)
ws.Copy After:=ws
Set ws = Worksheets(Worksheets.Count)
ws.Range("A1").Formula = "=" & Worksheets(Worksheets.Count - 1).Name & "!A1 + 1"
I have attached a copy of the file I'm working on.
Thank you so much for all the help you can give!
Just so you know, I have spent more than 12 hours on this, I don't know where time goes when I'm playing with this stuff.
Bookmarks