join more workbooks in one and print sheets

  • Thread starter Thread starter 71marco71
  • Start date Start date
7

71marco71

Hello friends
Every month I have to make a report for my boss. I have to print a lo
of tables and charts contained in 7 workbook. Is it possible to make
macro that join all workbooks in one and print all sheets contained i
the new workbook? the new workbook doesn't have to contain all sheet
of 7 workbooks because some sheets are not need and i don't prin
them.
I also have to number the pages before printing.
Thanks in advance for your hel
 
Generally do something like this pseudocode.

bkList = Array("Bk1.xls", "Bk2.xls", "Bk3.xls", _
"Bk4.xls", "Bk5.xls", "Bk6.xls", "Bk7.xls")
for i = lbound(bkList) to ubound(bklist)
set wkbk = workbooks.Open(blList(i))
if i = lbound(bkList) then
wkbk.Sheets.copy
set wkbk1 = ActiveWorkbook
else
wkbk.Sheets.Copy After:=wkbk1.Sheets(wkbk1.sheets.count)
end if
Next
' now delete sheets you don't want
wkbk1.Sheets.Select
activewindows.SelectedSheets.Printout
 
Thank you Tom
The macro works fine but for I have to specify, during the macro run,
that I don’t want to update data contained in one workbook I had ope
(the wkbk have a link with other workbooks present in my directory)
It’ s possible to avoid this problem? I would like to know some thing
too
1) I don’t understand how the new workbook that will contain all sheet
is open. Which line of your macro open the new workbook…I can see
copy command but I don’t see a paste command. How can I give a specifi
name to the new workbook and save it in a specific forlder? I woul
like also close the workbook I had previously open without saving it.
2) Where I have to input your macro (in which Workbook I can input it)
3) Before printing I have to number the pages…How can I do it?
Thank you very much for your help and sorry if I asked dumb question
but I’m a beginner in vb
 
Back
Top