R
RK
Pls. help! What's wrong with this code? This code is executed when the user
clicks the command button on the UserForm1. It print-previews the selected
worksheets.
Private Sub CommandButton1_Click()
For i = 1 To 13
If UserForm1.Controls("Checkbox" & i).Value = "True" Then
Worksheets("Sheet" & i).PrintPreview
End If
Next i
Unload Me
End Sub
VBA flags the 4th line (.PrintPreview) as "Subscript out of Range". Am I
missing a Dim statement?
Thanks.
clicks the command button on the UserForm1. It print-previews the selected
worksheets.
Private Sub CommandButton1_Click()
For i = 1 To 13
If UserForm1.Controls("Checkbox" & i).Value = "True" Then
Worksheets("Sheet" & i).PrintPreview
End If
Next i
Unload Me
End Sub
VBA flags the 4th line (.PrintPreview) as "Subscript out of Range". Am I
missing a Dim statement?
Thanks.