Microsoft Office Tutorials and References
In Depth Information
18.4.2.4 The Form's Initialize event
bNoneSelected = True
If cSheets = 0 Then
MsgBox "No sheets in this workbook.", vbExclamation
Exit Sub
Else
For i = 0 To lstSheets.ListCount - 1
If lstSheets.Selected(i) Then
bNoneSelected = False
' List box is 0-based, arrays are 1-based
ActiveWorkbook.Sheets(sSheetNames(i + 1)).PrintOut
End If
Next
End If
If bNoneSelected Then
MsgBox "No
sheets have been selected from the list box.", vbExclamation
End If
End Sub
Search JabSto ::




Custom Search