Ga naar hoofdinhoud

Hoe alle opties in een vervolgkeuzelijst in Excel afdrukken?

Heeft u ooit geprobeerd om alle opties in een vervolgkeuzelijst in een Excel-werkblad af te drukken? In dit artikel wordt gesproken over het afdrukken van alle opties in een vervolgkeuzelijst naar een afzonderlijke afdruk in Excel.

Druk alle opties af in een vervolgkeuzelijst met VBA-code


Druk alle opties af in een vervolgkeuzelijst met VBA-code

Met de volgende VBA-code kunt u alle opties in een vervolgkeuzelijst in het werkblad afdrukken. Ga als volgt te werk.

1. druk de anders + F11 toetsen om de te openen Microsoft Visual Basic voor toepassingen venster.

2. In de Microsoft Visual Basic voor toepassingen venster, klik dan Invoegen > Module. Kopieer vervolgens de volgende VBA-code naar het modulevenster. Zie screenshot:

VBA-code: druk alle opties in een opgegeven vervolgkeuzelijst af op een afzonderlijke afdruk

Sub Iterate_Through_data_Validation()
    Dim xRg As Range
    Dim xCell As Range
    Dim xRgVList As Range
    Set xRg = Worksheets("Sheet1").Range("B8")
    Set xRgVList = Evaluate(xRg.Validation.Formula1)
    For Each xCell In xRgVList
        xRg = xCell.Value
        ActiveSheet.PrintOut
    Next
End Sub

Note: In de code is Blad1 de werkbladnaam die de vervolgkeuzelijst bevat die u wilt afdrukken. En B8 is de cel die de vervolgkeuzelijst bevat. Vervang ze door de benodigde.

3. druk de F5 sleutel om de code uit te voeren.

Vervolgens worden alle opties in de opgegeven vervolgkeuzelijst in een bepaald werkblad afzonderlijk afgedrukt.


Druk eenvoudig gespecificeerde pagina's af in het huidige werkblad in Excel:

Met de Druk specifieke pagina's af nut van Kutools for Excel, kunt u eenvoudig opgegeven pagina's in het huidige werkblad afdrukken, zoals alles afdrukken oneven pagina's, alle even pagina's, gewoon afdrukken huidige pagina, en druk een aangepast paginabereik af, zoals hieronder afgebeeld.
Download en probeer het nu! (30 dagen gratis proefperiode)


Gerelateerde artikelen:

Beste Office-productiviteitstools

馃 Kutools AI-assistent: Een revolutie teweegbrengen in de data-analyse op basis van: Intelligente uitvoering   |  Genereer code  |  Aangepaste formules maken  |  Analyseer gegevens en genereer grafieken  |  Roep Kutools-functies aan...
Populaire functies: Zoek, markeer of identificeer duplicaten   |  Verwijder lege rijen   |  Combineer kolommen of cellen zonder gegevens te verliezen   |   Ronde zonder formule ...
Super opzoeken: Meerdere criteria VLookup    VLookup met meerdere waarden  |   VOpzoeken over meerdere bladen   |   Fuzzy opzoeken ....
Geavanceerde vervolgkeuzelijst: Maak snel een vervolgkeuzelijst   |  Afhankelijke vervolgkeuzelijst   |  Multi-select vervolgkeuzelijst ....
Kolom Beheerder: Voeg een specifiek aantal kolommen toe  |  Kolommen verplaatsen  |  Schakel de zichtbaarheidsstatus van verborgen kolommen in  |  Vergelijk bereiken en kolommen ...
Uitgelichte functies: Raster focus   |  Ontwerpweergave   |   Grote formulebalk    Werkmap- en bladbeheer   |  resource Library (Auto-tekst)   |  Datumkiezer   |  Combineer werkbladen   |  Cellen coderen/decoderen    Stuur e-mails per lijst   |  Super filter   |   Speciaal filter (filter vet/cursief/doorhalen...) ...
Top 15 gereedschapsets12 Tekst Tools (toe te voegen tekst, Tekens verwijderen, ...)   |   50+ tabel Types (Gantt Chart, ...)   |   40+ Praktisch Formules (Bereken leeftijd op basis van verjaardag, ...)   |   19 Invoeging Tools (QR-code invoegen, Afbeelding invoegen vanaf pad, ...)   |   12 Camper ombouw Tools (Getallen naar woorden, Currency Conversion, ...)   |   7 Samenvoegen en splitsen Tools (Geavanceerd Combineer rijen, Gespleten cellen, ...)   |   ... en meer

Geef uw Excel-vaardigheden een boost met Kutools voor Excel en ervaar effici毛ntie als nooit tevoren. Kutools voor Excel biedt meer dan 300 geavanceerde functies om de productiviteit te verhogen en tijd te besparen.  Klik hier om de functie te krijgen die u het meest nodig heeft...

Omschrijving


Office-tabblad Brengt een interface met tabbladen naar Office en maakt uw werk veel gemakkelijker

  • Schakel bewerken en lezen met tabbladen in Word, Excel, PowerPoint in, Publisher, Access, Visio en Project.
  • Open en maak meerdere documenten in nieuwe tabbladen van hetzelfde venster in plaats van in nieuwe vensters.
  • Verhoogt uw productiviteit met 50% en vermindert honderden muisklikken voor u elke dag!
Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am using the code above which is work great.  Now I need to get it to use the cell reference as the file name when it saves.  How do I do that?
This comment was minimized by the moderator on the site
kalo ingin mencetak sebagian data di drop list, gimana caranya mas ?
terima kasih
This comment was minimized by the moderator on the site
Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
This comment was minimized by the moderator on the site
Hello MichHave you found the VBA code for print all options in drop down list excluding the empty cell so as you can help is too.
This comment was minimized by the moderator on the site
Hi,The following VBA code helps to print all options in a specific drop-down list excluding the empty items. Hope I can help.<div data-tag="code">Sub Iterate_Through_data_Validation_NULL()
'Updated by Extendoffice 20211231
On Error Resume Next
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Dim xNum, xF As Integer
xNum = 2
Set xRg = Worksheets("Sheet1").Range("B17")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
xF = 1
For Each xCell In xRgVList
xRg = xCell.Value
If Trim(xCell.Value) = "" Then
Else
'ActiveSheet.PrintPreview
ActiveSheet.PrintOut
End If
Next
End Sub
This comment was minimized by the moderator on the site
Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
This comment was minimized by the moderator on the site
Hi,
The following VBA code helps to print all options in a specific drop-down list excluding the empty items. Hope I can help.
<div data-tag="code">Sub Iterate_Through_data_Validation_NULL()
'Updated by Extendoffice 20211231
On Error Resume Next
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Dim xNum, xF As Integer
xNum = 2
Set xRg = Worksheets("Sheet1").Range("B17")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
xF = 1
For Each xCell In xRgVList
xRg = xCell.Value
If Trim(xCell.Value) = "" Then
Else
'ActiveSheet.PrintPreview
ActiveSheet.PrintOut
End If
Next
End Sub
This comment was minimized by the moderator on the site
Hi is there a way to be able to preview first all the possible printouts in my drop-down list before it actually prints?
This comment was minimized by the moderator on the site
Hi Zack,The following VBA code helps to have a print preview before printing. After running the code, the print preview of a drop-down item pops up, you need to manually close the print preview to get the option to print out. <div data-tag="code">Sub Iterate_Through_data_Validation_NULL()
'Updated by Extendoffice 20211231
On Error Resume Next
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Dim xNum, xF As Integer
xNum = 2
Set xRg = Worksheets("Sheet1").Range("B17")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
xF = 1
For Each xCell In xRgVList
xRg = xCell.Value
If Trim(xCell.Value) = "" Then
Else
ActiveSheet.PrintPreview
ActiveSheet.PrintOut
End If
Next
End Sub
This comment was minimized by the moderator on the site
How can i select a specific droplist, i want to print? , For example if i have 200 names on my droplist and i want to print a specific list, maybe 50 out of 200, How will i do this please?
This comment was minimized by the moderator on the site
Hi,The VBA code below can help you achieve it. Please specify the number of items you want to print in the line "xNum = 10", and the first n options in the drop-down list will be printed out.<div data-tag="code">Sub Iterate_Through_data_Validation_Num1()
'Updated by Extendoffice 20211231
On Error Resume Next
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Dim xNum, xF As Integer
xNum = 10 'the number of items you want to print
Set xRg = Worksheets("Sheet1").Range("B17")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
xF = 1
For Each xCell In xRgVList
xRg = xCell.Value
'ActiveSheet.PrintPreview '??
ActiveSheet.PrintOut '??
If xF = xNum Then
Exit For
End If
xF = xF + 1
Next
End Sub
This comment was minimized by the moderator on the site
Thanks for the code. But I'm experiencing a minor issue when printing. When I tried to print the sheet with the drop down list. The first print out, prints the first item on the list while the next print out prints a blank data before it prints the second item from the list. What should I do?
This comment was minimized by the moderator on the site
Hi Cloud,
What version of Excel are you using?
The problem can't be reproduced in my case. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Sorry I totally forgot about this. I'm using Excel 2013.

So it wasn't actually a blank data.

I have this dynamic drop down list in cell R17 which also populates other cells in the worksheet using VLOOKUP Function. What happens during print out is that the odd-positioned items on the list appears on the cell while the even-positioned items seemed not to show up that's why I thought it's printing blank pages.

Thanks!
This comment was minimized by the moderator on the site
Thank you for the post, this has helped me a lot. I was wondering if you had a way to do VBA to print Page 1 based on one drop-down selection and print Page 1 and 2 based on another drop-down selection? Thanks for any help you can provide.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations