Hi,
I have a spreadsheet form with many sections in it. I have created named ranges for each section and would like to create a macro to print just that section of the form. (this is Excel 2003). (I am not a developer, just trying to work on some improvements in a paper form process!)
I recorded a macro to select the print area and then printed the selected area.
Instead of referencing a hard range, such as A1:G4, I'd like it to reference my named range, such as range1.
The range exists in sheet 1. I looked in Microsoft Help and to reference a named range and it said "The following example refers to the worksheet-specific range named "Sheet1!Sales" in the workbook named "Report.xls."
Sub FormatSales()
Range("[Report.xls]Sheet1!Sales")."
Sub PRINT_UAM_P_AP()
'
' PRINT_UAM_P_AP Macro
' Macro recorded 2/23/2009 by DOI
'
'
Range("A260:E333").Select
Selection.PrintOut Copies:=1, Collate:=True
End Sub
I tried to change my refence in my range to my named ranges but it isn't workin.
The sheet name: UAM-P
Workbook name: UAM-P
Named range: UAM_P_AC (exists in the sheet UAM_P)
worksheet-specific range named "Sheet1!Sales" in the workbook named "Report.xls.".
when I run it, I get the Run time error 1004, Method "range" of object _global failed. Do I need to declare my ranges somewhere?
Sub FormatSales()
Range("[UAM-P.xls]UAM-P!UAM_P_AC").select
I have a spreadsheet form with many sections in it. I have created named ranges for each section and would like to create a macro to print just that section of the form. (this is Excel 2003). (I am not a developer, just trying to work on some improvements in a paper form process!)
I recorded a macro to select the print area and then printed the selected area.
Instead of referencing a hard range, such as A1:G4, I'd like it to reference my named range, such as range1.
The range exists in sheet 1. I looked in Microsoft Help and to reference a named range and it said "The following example refers to the worksheet-specific range named "Sheet1!Sales" in the workbook named "Report.xls."
Sub FormatSales()
Range("[Report.xls]Sheet1!Sales")."
Sub PRINT_UAM_P_AP()
'
' PRINT_UAM_P_AP Macro
' Macro recorded 2/23/2009 by DOI
'
'
Range("A260:E333").Select
Selection.PrintOut Copies:=1, Collate:=True
End Sub
I tried to change my refence in my range to my named ranges but it isn't workin.
The sheet name: UAM-P
Workbook name: UAM-P
Named range: UAM_P_AC (exists in the sheet UAM_P)
worksheet-specific range named "Sheet1!Sales" in the workbook named "Report.xls.".
when I run it, I get the Run time error 1004, Method "range" of object _global failed. Do I need to declare my ranges somewhere?
Sub FormatSales()
Range("[UAM-P.xls]UAM-P!UAM_P_AC").select