Hello,
I have a macro that will make a specific number of copies of the active sheet based on the number that is entered in a message box.
Sub newtab()
'
' newtab Macro
'
' Keyboard Shortcut: Ctrl+Shift+W
Dim x As Integer
x = InputBox("Enter number of times to copy active sheet")
For numtimes = 1 To x
'Loop by using x as the index number to make x number copies.
ActiveWorkbook.ActiveSheet.Copy _
Before:=ActiveWorkbook.ActiveSheet
'Put copies in front of activesheet.
Next
End Sub
And another one that I Frankensteined together to put each copy in a separate workbook.
Sub copytabnewbook()
'
' copytabnewbook Macro
'
' keyboard shortcut: CTRL+Shift+H
On Error Resume Next
Dim x As Integer
x = InputBox("Enter number of times to copy active sheet")
For numtimes = 1 To x
'Loop by using x as the index number to make x number copies.
ActiveWorkbook.ActiveSheet.Copy _
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A1").Select
Next
End Sub
I have two questions about how I can change these to better serve my needs, the first is how can I change them so that they will copy multiple worksheets that I have grouped? The second question which is ultimately going to end up as a new macro is that with the second macro, instead of it creating each copy in an individual workbook, how can I change it to have all of the copies go to a single workbook?
Thanks in advance,
Tristan
Bookmarks