Results 1 to 9 of 9

Merging multiple workbooks

Threaded View

  1. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Merging multiple workbooks query

    You can't move sheets between workbooks.

    Sub tst7()
      For j = 1 To 7
        with workbooks.open( ThisWorkbook.Path & "\" & choose(j,"Resources","Comm","Strategy","Corp","BDU","Hosting","Quality") & ".xls")
          for each sh in .sheets
             with ThisWorkbook.Sheets.add
                 .cells(1,1).resize(sh.usedrange.rows.count,sh.usedrange.columns.count)=sh.usedrange
             end with
          next
          .Close False
        End With
      Next
    End Sub
    Last edited by snb; 07-01-2010 at 08:32 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1