Reputation: 101
I want to choose the print area using VBA and print them out.
I have tried this method, but it gives me an error
This formula is missing a range reference or a defined name
Worksheets("Printable Version").Activate
With Sheets("Printable Version")
ActiveSheet.PageSetup.PrintArea = .Range("A1").Value & ":" & .Range("G55").Value
End With
Upvotes: 1
Views: 8053
Reputation: 101
I figured it out bu using this piece of code:
WorkSheet("sheetname").range("A1:G55").printout
Upvotes: 1
Reputation: 14547
With Sheets("Printable Version")
.PageSetup.PrintArea = .Range("A1:G55").Address
'''Or
.PageSetup.PrintArea = "A1:G55"
.PrintOut
End With
Upvotes: 1