Print range arguments

Troy

New Member
Joined
Apr 2, 2002
Messages
47
I want to set a print range from b3 to activecell. I can't get the syntax right. Should I name the range first? That didn't seem to work either. Any suggestions? Thanks.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi
Select your range and then type "Print_Area" in the "Name Box" directly above A1.

If you are speaking in terms of VBA, then use the following line:

ActiveSheet.PageSetup.PrintArea = Selection.Address

Tom
 
Upvote 0
For some reason I can't grasp the concept of creating a range. My range is not selected, only the last cell. I tried several instances of:
ActiveSheet.PageSetup.PrintArea = "$B$3:Active.cell"
or
= "$B$3:Active.cell.address"
 
Upvote 0
Now I get it.

Sub SetPrint()
ActiveSheet.PageSetup.PrintArea = Range("B3:" & ActiveCell.Address).Address
End Sub

Example:
ActiveCell is cell N22
ActiveCell.Address = "$N$22"
MyRangeAddress = "B3:" & ActiveCell.Address
MyRangeAddress = "B3:N22" or actually "B3:$N$22"
PrintArea = Range("B3:N22").Address

This would work too.
ActiveSheet.PageSetup.PrintArea = "B3:" & ActiveCell.Address

Tom
This message was edited by TsTom on 2002-08-26 05:25
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,842
Members
449,193
Latest member
MikeVol

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top