Saltar al contenido principal

¿Cómo imprimir todas las opciones en una lista desplegable en Excel?

¿Alguna vez ha intentado imprimir todas las opciones en una lista desplegable en una hoja de cálculo de Excel? Este artículo habla de imprimir todas las opciones en una lista desplegable en una impresión separada en Excel.

Imprima todas las opciones en una lista desplegable con código VBA


Imprima todas las opciones en una lista desplegable con código VBA

El siguiente código VBA puede ayudarlo a imprimir todas las opciones en una lista desplegable en la hoja de trabajo. Haz lo siguiente.

1. presione el otro + F11 teclas para abrir el Microsoft Visual Basic para aplicaciones ventana.

2. En el Microsoft Visual Basic para aplicaciones ventana, haga clic en recuadro > Módulo. Luego copie el siguiente código VBA en la ventana del Módulo. Ver captura de pantalla:

Código VBA: imprima todas las opciones en una lista desplegable especificada en una impresión separada

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: En el código, Hoja1 es el nombre de la hoja de trabajo que contiene la lista desplegable que desea imprimir. Y B8 es la celda que contiene la lista desplegable. Reemplácelos con los necesarios.

3. presione el F5 clave para ejecutar el código.

Luego, todas las opciones de la lista desplegable especificada en una determinada hoja de trabajo se imprimen por separado.


Imprima fácilmente páginas específicas en la hoja de trabajo actual en Excel:

Con la Imprimir páginas específicas utilidad de Kutools for Excel, puede imprimir fácilmente páginas específicas en la hoja de trabajo actual, como imprimir todo páginas impares, todas incluso páginas, imprime solo página actual, así como imprimir un rango de páginas personalizado como se muestra a continuación.
¡Descárgalo y pruébalo ahora! (Pista gratuita de 30 días)


Artículos relacionados:

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
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