J
Joe Farruggio
Hi
Is there any way to set a print area from a macro
Is there any way to set a print area from a macro
Joe wrote:Jim said:Yes...record a macro while you set the print area.
Jim said:Yes...record a macro while you set the print area.
Joe Farruggio wrote:Jim said:There is A1 reference style and R1C1 reference style but no A1C1?
Add the address property to your range designation to provide a
string for the print area...
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(27, 6)).Address
Joe Farruggio wrote:Jim said:There is A1 reference style and R1C1 reference style but no A1C1?
Add the address property to your range designation to provide a
string for the print area...
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(27, 6)).Address
Joe Farruggio wroteJim said:You got a little carried away using the PrintArea.
This worked for me ...
Sub Macro1()
Dim Num As Long
Dim Numg As Long
Dim x As String
Cells(1, 1).Select
'Num = 32,36,40,44 and is selectable
'Numg = 8,9,10,11,12,13 and is selectable
Num = Cells(2, 6).Value
Numg = Cells(3, 3).Value
x = Range(Cells(1, 1), Cells(9 + Num, 3 + Numg)).Address
ActiveSheet.PageSetup.PrintArea = x
ActiveWindow.SelectedSheets.PrintPreview
End Sub