|
Re: PageSetup properties using variables
Hi froodo,
Thanks for that.
As you've created a named range you don't have to assign its value to variable, i.e.
Code:
Sub Macro1()
With ActiveSheet.PageSetup
.Orientation = Range("Orientation").Value
End With
End Sub
will work fine. If you really want to assign the value of the "Orientation" named range to a variable (which seems to me to be doubling handling), try this:
Code:
Sub Macro2()
Dim strOrientation As String
strOrientation = Range("Orientation").Value
With ActiveSheet.PageSetup
.Orientation = strOrientation
End With
End Sub
HTH
Robert
__________________
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to add to our reputation by clicking the blue scale icon in the top right-hand corner of my post
|