Hi all,
Looks like I've finally got a Vba query!
I've a workbook that is updated and renamed on a weekly basis.
I've recorded a Macro that takes 3 sheets from it and pastes them
into a new workbook, the first section of the code is shown below.
This opens a new book and re-names it TEMP.xls then starts to copy data
and reformat it.
At the moment it works fine as long as it's run from the Workbook
Rep Gen TEST BASE.xls (The Dev Version.)
The macro itself works perfectly however it will obviously not work
if I rename the workbook.
What I need is some advice/help on what I need to do to change the macro so it works from the report it's called from not just the DEV copy.
I think I need to change the line I've bolded out below but am not sure.
Any help greatly appreciated
Workbooks.add
ActiveWorkbook.SaveAs Filename:= _
"S:CUSTCAREResource Unitphone statsWeekly Stats6 Week SummariesRolling ReportsTEMP.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows("Rep Gen TEST BASE.xls").Activate
Sheets("RAW DATA ENTRY").Select
Range("C3:P69").Select
Range("P69").Activate
Selection.Copy
Windows("TEMP.xls").Activate
ActiveSheet.Paste
Columns("A:A").ColumnWidth = 13.9
ActiveWindow.Zoom = 70
Columns("N:N").ColumnWidth = 16.1
Columns("N:N").Select
Columns("M:M").ColumnWidth = 16.4
Range("P28").Select
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "6 Week Overall"
Range("D35").Select
Sheets("Sheet2").Select
Windows("Rep Gen TEST BASE.xls").Activate
Sheets("Team Raw Data").Select
Range("B3:H49").Select
Application.CutCopyMode = False
Selection.Copy
Windows("TEMP.xls").Activate
Thanks
DaveA
This message was edited by applebyd on 2002-10-10 09:22
This message was edited by applebyd on 2002-10-10 09:23
Looks like I've finally got a Vba query!
I've a workbook that is updated and renamed on a weekly basis.
I've recorded a Macro that takes 3 sheets from it and pastes them
into a new workbook, the first section of the code is shown below.
This opens a new book and re-names it TEMP.xls then starts to copy data
and reformat it.
At the moment it works fine as long as it's run from the Workbook
Rep Gen TEST BASE.xls (The Dev Version.)
The macro itself works perfectly however it will obviously not work
if I rename the workbook.
What I need is some advice/help on what I need to do to change the macro so it works from the report it's called from not just the DEV copy.
I think I need to change the line I've bolded out below but am not sure.
Any help greatly appreciated
Workbooks.add
ActiveWorkbook.SaveAs Filename:= _
"S:CUSTCAREResource Unitphone statsWeekly Stats6 Week SummariesRolling ReportsTEMP.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows("Rep Gen TEST BASE.xls").Activate
Sheets("RAW DATA ENTRY").Select
Range("C3:P69").Select
Range("P69").Activate
Selection.Copy
Windows("TEMP.xls").Activate
ActiveSheet.Paste
Columns("A:A").ColumnWidth = 13.9
ActiveWindow.Zoom = 70
Columns("N:N").ColumnWidth = 16.1
Columns("N:N").Select
Columns("M:M").ColumnWidth = 16.4
Range("P28").Select
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "6 Week Overall"
Range("D35").Select
Sheets("Sheet2").Select
Windows("Rep Gen TEST BASE.xls").Activate
Sheets("Team Raw Data").Select
Range("B3:H49").Select
Application.CutCopyMode = False
Selection.Copy
Windows("TEMP.xls").Activate
Thanks
DaveA
This message was edited by applebyd on 2002-10-10 09:22
This message was edited by applebyd on 2002-10-10 09:23