Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
How do I create a For loop within a For loop? Linking to specific cells in pivot table Excel Programming 2 January 24th 05 08:05 AM
For/Loop skipping one value in loop only Matt Jensen Excel Programming 6 January 8th 05 12:03 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"