+ Reply to Thread
Results 1 to 28 of 28

Excel 2007 : Combining data from multiple Excel Files

Hybrid View

  1. #1
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Combining data from multiple Excel Files

    good work . i was a little unsure from your sample.xls which cell{s} to save
    this bit well change to find the cells to copy
     'This is the section to customize, replace with your own action code as needed
            'Find last row and copy data
                LR = Range("A" & Rows.Count).End(xlUp).Row
                If NR = 1 Then      'copy the titles and data
                    Range("A1:A" & LR).EntireRow.Copy _
                        wbknew.Sheets("Master").Range("A" & NR)
                Else                'copy the data only
                    Range("A2:A" & LR).EntireRow.Copy _
                        wbknew.Sheets("Master").Range("A" & NR)
                End If
            'close file
    what we need to do is look in certain cell if they have a values then copy the ranges

    i think its a5 with row 7 to 10 and a15 with rows 17 to 20? or can you highlight the stuff you need.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  2. #2
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Combining data from multiple Excel Files

    OK. Working on it. Out of curiosity. What is the best VBA book out there?

  3. #3
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Combining data from multiple Excel Files

    OK, I'm working on this task again and I have a few thoughts that might simplify the tasks if you can help me figure out how to implement them.

    First, I believe that I will always need B3, G24, and J24 of each spreadsheet. Can you help me to amend the code
      'This is the section to customize, replace with your own action code as needed
            'Find last row and copy data
                LR = Range("A" & Rows.Count).End(xlUp).Row
                If NR = 1 Then      'copy the titles and data
                    Range("A1:A" & LR).EntireRow.Copy _
                        wbknew.Sheets("Master").Range("A" & NR)
                Else                'copy the data only
                    Range("A2:A" & LR).EntireRow.Copy _
                        wbknew.Sheets("Master").Range("A" & NR)
                End If
    to pick up these two cells from each spreadsheet?

    Second, I think that there is a command to have excel create separate worksheets where you have white space between sets of data. Is that correct? If so, can you remind me of what function will do this (if I'm thinking of a macro that you are familiar with and not a function, please let me know)?

    Thank you,

  4. #4
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Combining data from multiple Excel Files

    Third, using this great code to pull all of these separate files together, is there then a way to automatically transpose all of the rows to columns, and putting all of the data into colums A & B?

    I think that these three things would go a long way towards simplifying my life tonight.

    Thank you again for all of the help on this.

+ Reply to Thread

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