bademployee
Board Regular
- Joined
- Aug 19, 2010
- Messages
- 184
Hi all,
I keep getting compile error "End With without With" with:
Any help is appreciated.
Thanks
I keep getting compile error "End With without With" with:
Code:
Private Sub CommandButton1_Click()
With ActiveSheet
If OptionButton1.Value = True Then
.PageSetup.PrintArea = "$a$1:$z$55"
.PageSetup.Orientation = xlLandscape
.PageSetup.LeftMargin = Application.InchesToPoints(0.25)
.PageSetup.RightMargin = Application.InchesToPoints(0.25)
.PageSetup.TopMargin = Application.InchesToPoints(0.5)
.PageSetup.BottomMargin = Application.InchesToPoints(0.5)
.PageSetup.HeaderMargin = Application.InchesToPoints(0.3)
.PageSetup.FooterMargin = Application.InchesToPoints(0.3)
.PageSetup.Zoom = 65
.PrintPreview
If OptionButton2.Value = True Then
.PageSetup.PrintArea = "$a$1:$z$183"
.PageSetup.Orientation = xlLandscape
.PageSetup.LeftMargin = Application.InchesToPoints(0.25)
.PageSetup.RightMargin = Application.InchesToPoints(0.25)
.PageSetup.TopMargin = Application.InchesToPoints(0.5)
.PageSetup.BottomMargin = Application.InchesToPoints(0.5)
.PageSetup.HeaderMargin = Application.InchesToPoints(0.3)
.PageSetup.FooterMargin = Application.InchesToPoints(0.3)
.PageSetup.Zoom = 65
.PrintPreview
Unload Me
End With
End If
End Sub
Any help is appreciated.
Thanks