soultrain000
New Member
- Joined
- Dec 8, 2010
- Messages
- 37
Hi Folks,
I am trying to define a dynamic print area in my code but what am I missing?
Thanks.
I am trying to define a dynamic print area in my code but what am I missing?
Code:
Sub test()
Dim x As Integer
Dim printx As Range
Dim myrange As Range
x = Range("A1").End(xlDown).Row
Set printx = Range("A1:F" & x).Select
ActiveSheet.PageSetup.PrintArea = printx.Address
End Sub
Thanks.