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
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