Ik heb een werkmap met veel werkbladen waarvan alleen de eerste pagina van belang is, weet iemand een stukje VBA code hiervoor of zoek ik het te moeilijk en is er iets standaard in excel.
Pasja, bedankt maar ik heb een vba module waarin ik aanvink welke werkbladen ik wil printen, als de keuze is gemaakt begint deze direct en kan ik dus niet meer bij het afdrukbereik komen. Omgekeerd is het ook zo dat als ik de keuze in het afdrukbereik maak ook de vervolgactie (direct) printen is.
Sub ShowForm()
UserForm1.Show
End Sub
Private Sub CheckBox1_Click()
Dim iloop As Integer
For iloop = 1 To ListBox1.ListCount
ListBox1.Selected(iloop - 1) = CheckBox1.Value
Next
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Dim iloop As Integer
For iloop = 1 To ListBox1.ListCount
If ListBox1.Selected(iloop - 1) = True Then
Sheets(ListBox1.List(iloop - 1, 0)).PrintOut
ListBox1.Selected(iloop - 1) = False
End If
Next
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
Dim sSheet
For Each sSheet In Sheets
If sSheet.Type = 3 Then 'Chart sheet
ListBox1.AddItem sSheet.Name
ElseIf WorksheetFunction.CountA(sSheet.Cells) > 0 Then
ListBox1.AddItem sSheet.Name
End If
Next sSheet
End Sub
mijn dank voor uw moeite,
Jan
Pasja, bedankt maar ik heb een vba module waarin ik aanvink welke werkbladen ik wil printen, als de keuze is gemaakt begint deze direct en kan ik dus niet meer bij het afdrukbereik komen. Omgekeerd is het ook zo dat als ik de keuze in het afdrukbereik maak ook de vervolgactie (direct) printen is.
Sub ShowForm()
UserForm1.Show
End Sub
Private Sub CheckBox1_Click()
Dim iloop As Integer
For iloop = 1 To ListBox1.ListCount
ListBox1.Selected(iloop - 1) = CheckBox1.Value
Next
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Dim iloop As Integer
For iloop = 1 To ListBox1.ListCount
If ListBox1.Selected(iloop - 1) = True Then
Sheets(ListBox1.List(iloop - 1, 0)).PrintOut
ListBox1.Selected(iloop - 1) = False
End If
Next
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
Dim sSheet
For Each sSheet In Sheets
If sSheet.Type = 3 Then 'Chart sheet
ListBox1.AddItem sSheet.Name
ElseIf WorksheetFunction.CountA(sSheet.Cells) > 0 Then
ListBox1.AddItem sSheet.Name
End If
Next sSheet
End Sub
mijn dank voor uw moeite,
Jan
Laatst bewerkt: