setting a print area

G

Guest

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
 
G

Guest

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
 
G

Guest

Martin Fishlock said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top