Hi,
I need to merge to Macros to work with each other.
The first Macro grabs names in a cell range then makes new tab names with the names in those cells -
Sub Invoices_Add_Named_Tabs()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Address").Range("A2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Next MyCell
End Sub
The other macro copies a sheet and all its data into a new sheet -
Sub Invoices_Add_Invoice()
Dim x As Integer
x = InputBox("Enter number of times to copy Sheet1")
For numtimes = 1 To x
'Loop by using x as the index number to make x number copies.
'Replace "Sheet1" with the name of the sheet to be copied.
ActiveWorkbook.Sheets("Invoice").Copy _
After:=ActiveWorkbook.Sheets("Address")
Next
End Sub
I need the macro to make a new sheet according to the names in the cell range, and copy into each of the new tab the data from sheet "Invoice", so one month i may have 8 names, then the next month may have 16 names.
so for example if there is 8 cells to be made into 8 named tabs, then each of the 8 newly made tabs will have the same data from the sheet "Invoice"
if there are 16 cells to be made into 16 named tabs, then each of the 16 newly made tabs will have the same data from the sheet "Invoice"
Thank You in advance
Bookmarks