View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
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