bloodybrit90
Board Regular
- Joined
- Jul 18, 2011
- Messages
- 111
Hi,
I need to print the following areas that are on the worksheet "Zipcode Summary". Each area A1:U62, A63:U125, ect. should print on its own page if the range does not equal #N/A. I tried modifying the VBA I found, but do not know enough to get it to work.
Sub Print_Zips()
' Page 1
If Range("C6").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62"
End If
' Page 2
If Range("C69").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125"
End If
' Page 3
If Range("C132").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125,$A$126:$U$188"
End If
' Page 4
If Range("C195").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125,$A$126:$U$188,$A$189:$U$254"
End If
ActiveWindow.SelectedSheets.PrintPreview
End Sub
Any help would be great.
I need to print the following areas that are on the worksheet "Zipcode Summary". Each area A1:U62, A63:U125, ect. should print on its own page if the range does not equal #N/A. I tried modifying the VBA I found, but do not know enough to get it to work.
Sub Print_Zips()
' Page 1
If Range("C6").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62"
End If
' Page 2
If Range("C69").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125"
End If
' Page 3
If Range("C132").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125,$A$126:$U$188"
End If
' Page 4
If Range("C195").Value <> 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$62,$A$63:$U$125,$A$126:$U$188,$A$189:$U$254"
End If
ActiveWindow.SelectedSheets.PrintPreview
End Sub
Any help would be great.