Results 1 to 8 of 8

Do Until Loop - Transferring data from several workbooks to a Master workbook

Threaded View

  1. #1
    Registered User
    Join Date
    07-09-2013
    Location
    haiti
    MS-Off Ver
    Excel 2007
    Posts
    3

    Do Until Loop - Transferring data from several workbooks to a Master workbook

    Hello all,

    I am trying to transfer data from several workbooks (8 at the moment) to a single Master Workbook.

    All the headers are the same in all workbooks, the only difference are the number of rows, thus the use of Do Until to identify the last populated row

    I have tried using Do Until Loop but I always end up copying and pasting in the same row in my Master workbook.

    Here is the code, I see where the problem is but I cannot correct it. (my guess is Range C9 in the loop, it should be dynamic instead but i cant figure out the code to do this)

    PS: I'm a beginner in VBA and have always struggled with it

    sub import()
    
    Workbooks.Open Filename:="C:Source 1.xlsx"
      
        Range("c9").Select
         
        Do
    
            Range(Selection, Selection.End(xlToRight)).Select
                    Selection.Copy
                    ActiveWindow.ActivateNext
                        Range("C9").Select
                        ActiveSheet.Paste
                        
                        ActiveWindow.ActivateNext
                        ActiveCell.Offset(1, 0).Select
                        
            
            ActiveCell.Offset(1, 0).Select
    
          Loop Until IsEmpty(ActiveCell)
          
                ActiveWindow.ActivateNext
                ActiveCell.Offset(1, 0).Select
                
        Windows("Source 1.xlsx").Activate
    
        ActiveWindow.Close
    
    end sub
    Last edited by arlu1201; 07-10-2013 at 05:50 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