B
brandc
Hi,
I need some help please.
I am attempting to create a new spreadsheet from the macro and name
all the sheets according
to data in the original spreadsheet.
The original spreadsheet can change every month - so I need - what is
"copied" to be the name of each sheet.
my attempt below - actual hardcodes the "result" - I need it to be
what was copied -
Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"C:\Jan2004b.xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False
Windows("Jan2004.xls").Activate
Sheets("Numbers").Select
Range("A2").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1145"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Range("A3").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1308"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Range("A4").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1370"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Could you please advise - it would be greatly appreciated
Regards
Christine Brand
I need some help please.
I am attempting to create a new spreadsheet from the macro and name
all the sheets according
to data in the original spreadsheet.
The original spreadsheet can change every month - so I need - what is
"copied" to be the name of each sheet.
my attempt below - actual hardcodes the "result" - I need it to be
what was copied -
Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"C:\Jan2004b.xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False
Windows("Jan2004.xls").Activate
Sheets("Numbers").Select
Range("A2").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1145"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Range("A3").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1308"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Range("A4").Select
Selection.Copy
Windows("Jan2004b.xls").Activate
Sheets.Add.Name = "1370"
' This needs to be the selection.copy above
Windows("Jan2004.xls").Activate
Could you please advise - it would be greatly appreciated
Regards
Christine Brand