Here is my code
VBA is not printing the correct area instead it is printing C3:X212. (The correct area is "$c$3:$AA$212")
Can someone help?
VBA is not printing the correct area instead it is printing C3:X212. (The correct area is "$c$3:$AA$212")
Can someone help?
Code:
Sub test()
On Error Resume Next
Dim rootDir As String
rootDir = "M:\dept\SLNGNA\Gas LPM\Structuring\Daily Report\Daily PDF Files\New England Gas Fundamentals"
Sheets(Array("New England Balances", "LDCs MA")).Select
Sheets("New England Balances").Activate
ActiveSheet.PageSetup.PrintArea = "$c$3:$AA$212"
Range("$c$3:$AA$212").Select
Sheets("LDCs MA").Activate
ActiveSheet.PageSetup.PrintArea = "$b$2:$x$135"
Range("$b$2:$x$135").Select
Selection.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="m:\Dept\SLNGNA\Gas LPM\Structuring\Daily Report\Daily PDF Files\New England Gas Fundamentals_" & VBA.Format(Date, "MMDDYYYY") & ".pdf", _
Quality:=xlQualityStandard, _
OpenAfterPublish:=True
End Sub