I have a workbook that I want the worksheets to auto name with the date and copy the conditional formatting to the next worksheet. My problem is that the name of the worksheet isn't naming correctly but the conditional formatting is working. I have two macros. I am not sure if the second macro is the culprit.
Code:
Sub CopyDayForward()
'
' CopyDayForward Macro
'
' Keyboard Shortcut: Ctrl+Shift+F
'
ActiveWindow.SmallScroll Down:=24
Range("A1:U65").Select
Range("U65").Activate
Selection.Copy
xCurrentSheetDate = Format(DateValue(Right(ActiveSheet.Name, 2) + "-" + Mid
(ActiveSheet.Name, 10, 4) + "-" + Mid(ActiveSheet.Name, 5, 4)) + 1, "yyyy mmm dd")
Sheets.Add(After:=ActiveSheet).Name = "PAVE " & xCurrentSheetDate
ActiveSheet.PasteSpecial xlPasteAllMergingConditionalFormats
ActiveSheet.PasteSpecial xlPasteColumnWidths
Columns("A:A").ColumnWidth = 8.29
Columns("A:A").EntireColumn.AutoFit
ActiveWindow.SmallScroll ToRight:=8
ActiveSheet.Buttons.Add(1629, 5.25, 100.5, 25.5).Select
Application.CutCopyMode = False
Selection.OnAction = "CopyDayForward"
ActiveSheet.Shapes("Button 1").IncrementLeft -3
ActiveSheet.Shapes("Button 1").IncrementTop -3
Selection.Characters.Text = "Copy Day Forward"
With Selection.Characters(Start:=1, Length:=16).Font
.Name = "Calibri"
.FontStyle = "Bold"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
End With
End Sub
[code]
Sub Create()
Dim I As Long
Dim xNumber As Integer
Dim xNumber As String
Dim xActiveSheet As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
Set xActiveSheet = ActiveSheet
xNumber = InputBox("Inter number of times to copy the current sheet")
For I = 1 To xNumber
xName = ActiveSheet.Name
xActiveSheet.Copy After:""ActiveWorkbook.Sheets(xName)
ActiveSheet.Name = "Template-" & I
Next
xActiveSheet.Activate
Application.ScreenUpdating "True"
End Sub