VBA Macro Loop Through and Print Combo Box Options

amy felt

New Member
Joined
Feb 7, 2012
Messages
3
Hello,

I have an excel dashboard and a combo box drives it. I need the user to be able to hit a print icon and have it loop through each sales manager in the combo box and print the page. The macro I have below runs over and over and will not stop. It also only prints the first name in the combo box. How do I get it to work where:

Combo box located on "US Core Dashboard" cells M6:P6
Combo box is linked to "APV Tables" cell C54
Combo box list range is linked to "APV Tables" cell A54:A66
Print range of the paper is on "US Core Dashboard" range B2:AD91

Sub printlist()
If MsgBox("You are about to print reports for every manager. If you only want to print for one manager, select him from the drop down and hold down control-P. Do you wish to continue?", vbOKCancel, "Warning!!!") = vbOK Then
Dim bottomCell As Range
Set bottomCell = Worksheets("APV Tables").Range("a53").End(xlDown)
Dim H As Integer
H = 1
Do While H <= bottomCell.Row
H = H + 1
Sheets("US Core Dashboard").Range("m6") = Worksheets("APV Tables").Range("a53" & H)
printlist
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Loop
Else
End If
End Sub

Thanks!!
Best,
Amy
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top