Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When sheet called 'January' is complete, I have set up a command button which
when clicked, will create a new sheet which is to be named as the following month - in this case 'February'. How do I tweak the following code to name the new sheet by the correct month? Sub CopyShtPlus1Month() Dim shtName As String, newShtName As String shtName = ActiveSheet.Name newShtName = ActiveSheet.Name + WHAT DO I ADD HERE??? If Not SheetExists(newShtName) Then ActiveSheet.Copy After:=ActiveSheet ActiveSheet.Name = newShtName Sheets(newShtName).Activate Range("C7:M43").Select Selection.ClearContents Range("C9").Select Else MsgBox "You've already created a sheet for this month.", vbCritical End If End Sub Thanks for suggestions -- Traa Dy Liooar Jock |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro: Copy a worksheet and rename it to a specified value | Excel Discussion (Misc queries) | |||
Copy worksheet and rename sheet | Excel Discussion (Misc queries) | |||
Rename a worksheet after copy... | Excel Programming | |||
Worksheet copy with rename | Excel Programming | |||
copy worksheet from previous month and rename to current month | Excel Programming |