Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vba routine to print a list of documents/worksheets

If someone could help me with this I'd be most grateful.

I would like to have the name of a document in A1 and the number of copies
to be printed in B1.

(and so on down the column)

all documents, spreadsheets are formatted to fit on one page and they are
all in the same directory.

regards,
DL


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default vba routine to print a list of documents/worksheets

Try something like the following:

Dim Rng As Range
Dim WB As Workbook
For Each Rng In ActiveSheet.UsedRange.Columns(1).Cells
Set WB = Workbooks.Open(Filename:=Rng.Text)
WB.Worksheets(1).PrintOut copies:=Rng(1, 2).Value
WB.Close savechanges:=False
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Mirsten Choiple" wrote in message
...
If someone could help me with this I'd be most grateful.

I would like to have the name of a document in A1 and the
number of copies to be printed in B1.

(and so on down the column)

all documents, spreadsheets are formatted to fit on one page
and they are all in the same directory.

regards,
DL




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vba routine to print a list of documents/worksheets

Thank you Chip; it works beautifully,

DL


"Chip Pearson" wrote in message
...
Try something like the following:

Dim Rng As Range
Dim WB As Workbook
For Each Rng In ActiveSheet.UsedRange.Columns(1).Cells
Set WB = Workbooks.Open(Filename:=Rng.Text)
WB.Worksheets(1).PrintOut copies:=Rng(1, 2).Value
WB.Close savechanges:=False
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Mirsten Choiple" wrote in message
...
If someone could help me with this I'd be most grateful.

I would like to have the name of a document in A1 and the number of
copies to be printed in B1.

(and so on down the column)

all documents, spreadsheets are formatted to fit on one page and they are
all in the same directory.

regards,
DL






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
VB routine to print to PDF? fedude Excel Worksheet Functions 4 March 15th 08 02:04 AM
Print routine needed for code pano Excel Worksheet Functions 3 February 11th 07 02:27 PM
How do I print a list of the documents not each document Felicia Excel Discussion (Misc queries) 2 January 3rd 07 08:47 PM
How do I print a LIST of documents in a folder littlebear20 Excel Discussion (Misc queries) 2 August 16th 06 11:44 PM
How do I right-click print from Open documents list? Excel Short Cut Printing Excel Discussion (Misc queries) 0 April 18th 05 07:51 PM


All times are GMT +1. The time now is 09:26 AM.

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

About Us

"It's about Microsoft Excel"