I have a simple Inputbox macro that creates a new sheet called whatever is unput. When hitting the cancel button though I get an error (object defined 1004 job)
How do I solve this?
![]()
Sub NewS() Dim Sheetname As String Worksheets("Template").Visible = True Sheetname = InputBox("Please enter new sheet name, Use format MMM YYYY") ActiveWorkbook.Sheets("Template").Copy after:=Sheets(Sheets.Count) ActiveSheet.Name = Sheetname ActiveSheet.Range("A1").Value = Sheetname MsgBox "Dont forget to fill in Budget and Forecast values" Worksheets("Template").Visible = False End Sub
Bookmarks