View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Macro to merge open workbooks

Basic code would be:

Sub CopySheets()
Dim bk As Workbook, bk1 As Workbook
Set bk = Workbooks.Add()
For Each bk1 In Application.Workbooks
If bk1.Windows(1).Visible Then
Application.DisplayAlerts = False
bk1.Worksheets.Copy After:=bk.Worksheets(bk.Worksheets.Count)
Application.DisplayAlerts = True
End If
Next
End Sub


--
Regards,
Tom Ogilvy


"Barry McConnell" wrote:

My intranet won't let me access that site. Can you please give me the code Ron?

"Ron de Bruin" wrote:

See your other thread

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Barry McConnell" wrote in message
...
Is there a small macro that will take all the worksheets from all open
workbooks and put them in one new consolidated workbook?

Thanks

Barry