I've got a macro that i think should be working, but it's not working the way I intend. What I want it to do is ask how many sheets need to be inserted, then take the input and insert that many sheets.
It asks the question, but it only inserts one sheet, and I don't understand why. I've tried DIMming "Count" as Long, as a Range, and as an Integer, with no effect other than an error on "Range". It works the same just doing "DIM Count". I'd appreciate some help on this one.
Thanks,
John
![]()
Sub CreateSheets() Dim Count On Error Resume Next Application.DisplayAlerts = False Count = Application.InputBox _ (Prompt:="How many sheets do you want to insert?", _ Title:="HOW MANY?", Type:=1 + 8) On Error GoTo 0 Application.DisplayAlerts = True If IsNumeric(Count) And Count <> 0 Then Worksheets.Add After:=Worksheets(Worksheets.Count) Else Exit Sub End If End Sub
Bookmarks