+ Reply to Thread
Results 1 to 2 of 2

VBA to transfer data from multiple workbooks to one central spreadsheet

  1. #1
    Registered User
    Join Date
    02-04-2016
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    1

    VBA to transfer data from multiple workbooks to one central spreadsheet

    Hi,
    I am using the below code to transfer data from 10 individual spreadsheets saved in one folder called the ‘suppliers-master’ which is in a column format to a master spreadsheet ‘zmaster’ saved in the same folder. I need the data to paste in a row format one after the other so that I have 10 rows of data at the end. Additionally, some of the fields in my individual spreadsheets I would like to ignore either because I don’t need the information on the master or because they are blank.
    The below code copies and paste the data fine into the master spreadsheet but it is in a column format and the 10 separate spreadsheet’s data follow one after the other in a long column down A1.
    At the moment I am just manually transposing the data to rows.
    Hope that makes sense, and if anyone has a solution it would be greatly appreciated!
    Thanks
    Kirsty
    Sub LoopThroughDirectory()
    Dim MyFile As String
    Dim erow
    MyFile = Dir("C:\suppliers-master\")
    Do While Len(MyFile) > 0
    If MyFile = "zmaster.xlsm" Then
    Exit Sub
    End If
    Workbooks.Open (MyFile)
    Range("B3:b45").Copy
    ActiveWorkbook.Close

    erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    ActiveSheet.Paste Destination:=Worksheets("sheet1").Range(Cells(erow, 1), Cells(erow, 15))

    MyFile = Dir

    Loop

    End Sub

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: VBA to transfer data from multiple workbooks to one central spreadsheet

    Hi k_duffy, welcome to the forum.
    It does not really make sense, but see if this is what you want.
    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 02-04-2016 at 10:42 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Transfer data from multiple workbooks into Master workbook in SharePoint
    By faraha91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2016, 05:58 AM
  2. Automatically sort data and transfer to multiple workbooks and worksheets
    By BTraves in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2015, 04:17 PM
  3. [SOLVED] How to transfer specific row of data from multiple workbooks to master workbook using VBA
    By rajeshntiwari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2014, 08:08 AM
  4. [SOLVED] Transfer Data from Multiple SharePoint Workbooks into Master Workbook Automatically
    By bjnockle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2014, 10:37 PM
  5. Replies: 12
    Last Post: 04-18-2014, 09:05 AM
  6. Transfer data between multiple user-selected workbooks
    By UseItOrLoseIt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 12:57 PM
  7. Linking multiple NEW workbooks to one central workbook
    By litzwhip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-06-2013, 01:51 PM

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