+ Reply to Thread
Results 1 to 2 of 2

Consolidate Worksheets from multiple .CSV workbooks

Hybrid View

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    15

    Consolidate Worksheets from multiple .CSV workbooks

    folks - I am close using a code from another thread but cant seem to crack the code to copy rows A1:A6 from all the workbooks into the Master sheet. I get the first row only. I need the first 6 rows copied, skip a row, copy the next sheet first six rows, skip a row, etc until all 50 sheets have been copied into the Master. All help is appreciated!
    MacroCode:
    'Create a workbook for the recap report
    Set Master = ThisWorkbook

    Do
    Workbooks.Open (myPath & "\" & CurrentFileName)
    Set sourceBook = Workbooks(CurrentFileName)
    Set sourceData = sourceBook.Worksheets(1)

    With sourceData
    Range("A1:Z" & Range("A" & Rows.Count).End(xlUp).Row).Copy _
    Master.Worksheets(1).Range("A" & Rows.Count).End(xlUp).Offset(2, 0)
    End With

    sourceBook.Close

    'Calling DIR w/o argument finds the next .xlsx file within the current directory.
    CurrentFileName = Dir()
    Loop While CurrentFileName <> ""

    MsgBox "Consolidation complete"

    Application.ScreenUpdating = True

    End Sub

  2. #2
    Registered User
    Join Date
    11-01-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Consolidate Worksheets from multiple .CSV workbooks

    I forgot to add - a bonus would be,If possible, to capture the filename with each copy/paste or sheetname and add it to/above/below the 6 rows of copied data as they equate to quote numbers associated with the data in the row.

+ 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. Consolidate from multiple workbooks
    By delt127 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2011, 12:44 PM
  2. Consolidate worksheets from different workbooks
    By Tesleem in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-07-2010, 04:04 PM
  3. Consolidate multiple worksheets and workbooks
    By knightcloud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2010, 04:41 AM
  4. consolidate multiple workbooks
    By semo in forum Excel General
    Replies: 1
    Last Post: 11-28-2007, 08:00 AM
  5. Consolidate multiple workbooks
    By BillMarshall in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-26-2005, 05:45 AM

Tags for this Thread

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