+ Reply to Thread
Results 1 to 8 of 8

Help with a Macro to pull from multiple ss (rows variable) to a master

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    7

    Help with a Macro to pull from multiple ss (rows variable) to a master

    Hi all,
    I'm very very new to working with Macros, but I'm trying to create one to pull data from multiple spreadsheets into one master spreadsheet (the number of rows will be a variable).
    I will have 10 spreadsheets titled:
    DB
    DL
    HC
    HE
    JC
    KB
    MB
    MNC
    NS
    SM
    Then a master

    The columns will be from A2 - AK2 (again the number of rows will change daily)

    Is there any sort of macro that can pull the data from all 10 spreadsheets and place them into a single master spreadsheet? I need to be able to do this throughout the day so I can run reports.

    Any help would be really appreciated!

    Thanks a bunch!
    Last edited by elygion; 07-10-2013 at 02:19 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    When you say spreadsheets, do you mean separate files or separate worksheets in the same file?

    Will the master file already have data in it? If yes, do you want the existing data to be deleted before fresh data is input or do you want the fresh data to be input in the next available row of the master?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Basically, the 10 ss will be individual's work logs for the day. Since very one needs to make active changes throughout the day, I think they need to be their own files so there wont be a saving issue.

    I need to be able pull the data whenever I need to see what has been accomplished. So if possible, it'd need to be able to replace the old data on the master ss (which will be blank save for a header for each column). I tried to do this by linking cells so I could have real time updates, but since the number of rows changes constantly it wouldn't work.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Try this code - Change the path mentioned to the path where the files reside.

    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

  5. #5
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Thanks a bunch for the help!
    I hit a snag.

    Do
    Workbooks.Open (myPath & "\" & CurrentFileName)


    Is there something I need to enter between the ""?

  6. #6
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Ok, I have an update. I've got the macro to run. However, it is only pulling the A2. It seems to be ignore all other cells.

  7. #7
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Scratch that. Its working!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with a Macro to pull from multiple ss (rows variable) to a master

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ 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