Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you Print with a loop?
I have a drop downlist (data validation) that changes my report data. want to use a 'loop' to print the 15 odd reports automatically withou having to click through each combination. Any help is appreciated Thanks! :confused -- rohrl7 ----------------------------------------------------------------------- rohrl77's Profile: http://www.excelforum.com/member.php...fo&userid=2424 View this thread: http://www.excelforum.com/showthread.php?threadid=37853 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you Print with a loop?
Here is some code for you. You will need to change a couple of things to make
it work. I have commented the code where it needs to be changed. For debug purposes it is set to printpreview instead of print. Just change the commenting of the Printout line... Sub PrintList() Dim wks As Worksheet Dim rngDropDown As Range Dim rngList As Range Dim rngCurrent As Range Set wks = Sheets("Sheet1") 'Change this Set rngDropDown = wks.Range("A1") 'Change this Set rngList = Range(rngDropDown.Validation.Formula1) For Each rngCurrent In rngList rngDropDown.Value = rngCurrent.Value 'wks.PrintOut wks.PrintPreview Next rngCurrent End Sub -- HTH... Jim Thomlinson "rohrl77" wrote: I have a drop downlist (data validation) that changes my report data. I want to use a 'loop' to print the 15 odd reports automatically without having to click through each combination. Any help is appreciated. Thanks! -- rohrl77 ------------------------------------------------------------------------ rohrl77's Profile: http://www.excelforum.com/member.php...o&userid=24248 View this thread: http://www.excelforum.com/showthread...hreadid=378538 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you Print with a loop?
If your list is from a range or a named range, then you simply use code like
Dim myCell As Range For Each myCell In Range("DataValidationListRange") Range("CellwithDropdown").Value = myCell.Value Application.CalculateFull ActiveSheet.PrintOut Next myCell HTH, Bernie MS Excel MVP "rohrl77" wrote in message ... I have a drop downlist (data validation) that changes my report data. I want to use a 'loop' to print the 15 odd reports automatically without having to click through each combination. Any help is appreciated. Thanks! -- rohrl77 ------------------------------------------------------------------------ rohrl77's Profile: http://www.excelforum.com/member.php...o&userid=24248 View this thread: http://www.excelforum.com/showthread...hreadid=378538 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you Print with a loop?
Bernie & Jim, Thank you for your help! Both codes work well for my problem! Cheers, Luka -- rohrl7 ----------------------------------------------------------------------- rohrl77's Profile: http://www.excelforum.com/member.php...fo&userid=2424 View this thread: http://www.excelforum.com/showthread.php?threadid=37853 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
How do I create a For loop within a For loop? | Excel Programming | |||
For/Loop skipping one value in loop only | Excel Programming | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |