Hello everyone, I am a first time poster here, but a long time user of Excel. I have not needed to dabble in macros or VBA until recently, so I'm fairly new with them.
Using: Excel 2010
Prominent Cell:
H4 = Pay Period Ending Date, drop down list of dates through the PPE 12/6/2013
Current Tabs:
6.7 - 6.21 - 7.5 - 7.19
Question:
How would I copy the active tab, place it at the end of all tabs, change H4 to show current PPE Date and reference it as the name for the newly copied tab?
Example:
Lets say I did not create tab 7.19 yet
Active tab is 7.5, I want to copy the active tab and place it at the end of all the tabs (so the name of the new tab is 7.5(copy), change cell H4 to show current pay period ending date of 7.19, then rename 7.5(copy) to 7.19.
This is what I have currently, including clearing time entered in the cells that are being cleared.
ActiveWorkbook.CheckCompatibility = False
Sheets("7.5").Select
Sheets("7.5").Copy After:=Sheets(3)
Range("B13:C19").Select
Selection.ClearContents
Range("E13:F19").Select
Selection.ClearContents
Range("B23:C29").Select
Selection.ClearContents
Range("E23:F29").Select
Selection.ClearContents
Range("B13").Select
ActiveWorkbook.Save
End Sub
My thoughts with the above code is that it will always select sheet 7.5 and create 7.5(copy) after the 3rd sheet in the workbook.
I hope I've explained what I'm trying to do well enough.
I appreciate your help!
Using: Excel 2010
Prominent Cell:
H4 = Pay Period Ending Date, drop down list of dates through the PPE 12/6/2013
Current Tabs:
6.7 - 6.21 - 7.5 - 7.19
Question:
How would I copy the active tab, place it at the end of all tabs, change H4 to show current PPE Date and reference it as the name for the newly copied tab?
Example:
Lets say I did not create tab 7.19 yet
Active tab is 7.5, I want to copy the active tab and place it at the end of all the tabs (so the name of the new tab is 7.5(copy), change cell H4 to show current pay period ending date of 7.19, then rename 7.5(copy) to 7.19.
This is what I have currently, including clearing time entered in the cells that are being cleared.
ActiveWorkbook.CheckCompatibility = False
Sheets("7.5").Select
Sheets("7.5").Copy After:=Sheets(3)
Range("B13:C19").Select
Selection.ClearContents
Range("E13:F19").Select
Selection.ClearContents
Range("B23:C29").Select
Selection.ClearContents
Range("E23:F29").Select
Selection.ClearContents
Range("B13").Select
ActiveWorkbook.Save
End Sub
My thoughts with the above code is that it will always select sheet 7.5 and create 7.5(copy) after the 3rd sheet in the workbook.
I hope I've explained what I'm trying to do well enough.
I appreciate your help!