Results 1 to 17 of 17

Combine data of some cells in multiple excel files into one sheet

Threaded View

  1. #9
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Combine data of some cells in multiple excel files into one sheet

    Quote Originally Posted by lotuxel View Post
    Hi rocdamiani,
    Pls see below and you have to put all the files to one file's sheets and Goal sheet is target sheet.
    Sub jw_test()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim ws1 As Worksheet
    Dim re As Variant
    Dim i As Long
    Dim j As Long
    Dim rng As String
       
    Set wb = ActiveWorkbook
    Set ws = wb.Worksheets("Goal")
    j = 2
    For Each ws1 In wb.Worksheets
    
       If ws1.Name <> "Goal" Then
             ws.Cells(j, 1) = ws1.Name
          For i = 0 To 100
                re = Array("C3", "C5", "C8", "D8", "E8", "D9", "G13", "H13", "F22", "F24", "F26", "F29", "F31", "F34", "F40", "D43", "E43", "F46", "D49", "E49", "F52", "F55", "C58", "C59", "C60", "C61", "C62", "")
                rng = re(i)
                If rng = "" Then Exit For
                    ws.Cells(j, i + 2) = ws1.Range(rng).Value
         Next i
         End If
         j = j + 1
    Next ws1
    End Sub
    Hi lotuxel,
    Thank you for your reply.

    Sorry but I didn't understand very well.
    I thought the macro was going to open each excel file in the folder and copy those cells into the goal sheet.
    Is that happening in the macro? Or how it works? I couldn't understand very well your explanation before the code

    Looking forward to hear from you
    Last edited by ricdamiani; 08-06-2013 at 06:38 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to consolidate data from multiple excel files into single sheet in new book?
    By Pradeep M B in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2013, 09:37 AM
  2. Load multiple excel files into an excel sheet and extract data
    By Martijn79 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-03-2013, 06:08 PM
  3. Combine multiple excel files to one
    By anoopbaiju in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-03-2013, 09:04 AM
  4. copy multiple excel files data into one sheet?
    By jayh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2005, 09:05 AM
  5. how to combine multiple files in ms excel
    By fifi in forum Excel General
    Replies: 1
    Last Post: 01-12-2005, 08:06 AM

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