Print All Options in drop-down List

This post will guide you how to print all options in a drop down menu list in a worksheet. How do I print all options in a drop down menu into separate printout in excel. How to print all options in a drop down menu with VBA code in excel.

 

For example, there is a spreadsheet that give you profit for each of 20 branch companies depending which one you pick from a drop down menu. And what you want to do is that how to print all these 20 branches from the drop down menu list without manually picking each item and printing.

Print All Options in drop-down List


To print all options in a drop down menu list in a worksheet into separate printout, just do the following steps:

#1 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.

Get the position of the nth using excel vba1

#2 then the “Visual Basic Editor” window will appear.

#3 click “Insert” ->”Module” to create a new module

convert column number to letter3

#4 paste the below VBA code into the code window. Then clicking “Save” button.

print all options1

Sub printAllOptions()
    Dim dvCell As Range
    Dim inputRange As Range
    Dim c As Range
    'Which cell has data validation
    Set dvCell = Worksheets("Sheet1").Range("B1")

    'Determine where validation comes from
    Set inputRange = Evaluate(dvCell.Validation.Formula1)

    For Each c In inputRange
        dvCell = c.Value
        'add some print page code here
    Next c
End Sub

#5 back to the current worksheet, then run the above excel macro. Click Run button.

print all options2

Related Posts

Find and Replace Multiple Values

This post will guide you how to find and replace multiple values at once with VBA macro or using formula  in Excel. How do I make multiple find and replace in Excel. Suppose that you have a few cells containing ...

VBA Macro For VLOOKUP From Another Sheet

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Insert Comments in Protected Worksheet in Excel

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

How To Hide Every Other Row in Excel (Using VBA)

This post will show you how to hide alternate rows or columns in Excel or how to hide every third, fourth, fifth row or column in Excel. If you want to hide every other row in your current worksheet, how ...

Sidebar