Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
setting a print area
I cannot arrive at the correct syntax to define my selected range as the print area: Set prntRng = Range(Cells(1, 1), Cells(i, 12)) prntRng.Select ActiveSheet.PageSetup.PrintArea = Help appreciated, many thanks Matilda |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
setting a print area
The printarea is specified as a string. You therefore need to provide a
string like ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i or if you want to use the range address then: Set prntRng = Range(Cells(1, 1), Cells(i, 12)) ActiveSheet.PageSetup.PrintArea = prntRng.address HTHs "Matilda" wrote: I cannot arrive at the correct syntax to define my selected range as the print area: Set prntRng = Range(Cells(1, 1), Cells(i, 12)) prntRng.Select ActiveSheet.PageSetup.PrintArea = Help appreciated, many thanks Matilda |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
setting a print area
"Martin Fishlock" wrote: The printarea is specified as a string. You therefore need to provide a string like ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i or if you want to use the range address then: Set prntRng = Range(Cells(1, 1), Cells(i, 12)) ActiveSheet.PageSetup.PrintArea = prntRng.address HTHs "Matilda" wrote: I cannot arrive at the correct syntax to define my selected range as the print area: Set prntRng = Range(Cells(1, 1), Cells(i, 12)) prntRng.Select ActiveSheet.PageSetup.PrintArea = Help appreciated, many thanks Matilda Absolutely perfect, thankyou Martin! I can sleep now :-) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print Area Setting | Excel Discussion (Misc queries) | |||
Setting The Print-Area ? | New Users to Excel | |||
Setting print area | Excel Discussion (Misc queries) | |||
Setting print area with vba | Excel Programming | |||
Setting print area | Excel Programming |