Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Do Until Loop Question, for Printing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Renee - 31 Mar 2006 22:30 GMT
Good afternoon all,

    I have a list of names on a worksheet named Lists. On the Main
worksheet, I have a drop down field that references the range of names
(called Names).

If anyone can please help me with the code to automatically:
1. In the drop down, select the first name (B1)
   (This generates a report on the Main worksheet in A2:J20)
2. Print the Main worksheet
3. Select the next name
4. Print the Main worksheet
..repeat until there are no more names (i.e. blank cell in column A on the
Lists Worksheet)

Thank you, and have a great weekend!
Renee
Tom Ogilvy - 31 Mar 2006 22:49 GMT
You said the range is named Lists, then I think you said it is named Names.  
C11 below represents where the dropdown places the selection.  Change to
suit.

Sub ABC()
Dim cell as Range
for each cell in Range("Lists")
 Worksheets("Sheet1").Range("C11").Value = cell.Value
 worksheets("Main").Range("A2:J20").Printout
Next
End Sub

Signature

Regards,
Tom Ogilvy

> Good afternoon all,
>
[quoted text clipped - 13 lines]
> Thank you, and have a great weekend!
> Renee
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.