+ Reply to Thread
Results 1 to 13 of 13

Macro to copy data from other workbooks based on cell value

  1. #1
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Question Macro to copy data from other workbooks based on cell value

    Morning,

    I have about 10 workbooks that I want to be able to go into and get the data copied from them on to a master workbook, if a cell value is less than a certain number. It is ten or so separate workbooks and they will all be copied onto one workbook. I only want them copied if the cell value on that row is less than a certain number.

    Can anyone help?

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    Is this cell value that you are testing to see if it is < than this 'certain number' always in the same column on each Workbook?

    Do you want this 'certain number' to be static or have a cell where you can enter its value?

    Are all the other Workbooks in the same folder as the 'Master' Workbook?

    Can you attach the Master Workbook and 1 of your other workbooks where the data will be copied from? That will make it easier/faster for someone to help you..

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    Yes it will always be in the same column.

    It can be either...although for one of the sheets I'd want it to be different.

    Yes they are in the same folder

  4. #4
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    Emm for the sample workbooks I'm not allowed to upload the actual things but i could possibly make a dummy set. It's just a simple table.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    Hi..

    Try the attached.. i have zipped a Master Workbook and 3 other dummy Workbooks..

    Change the filepath in 2 places to your own... also. if they are .xls files (instead of .xlsx files).. change the following:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    Thanks very much. Looks good at first knockings. I'll try it in a few.

    Cheers

  7. #7
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    k.. don't forget to extract the files into 1 Folder that has no other files...

  8. #8
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    Apo,

    What do I need to change to get this putting the data into another set of cells in the master sheet?

  9. #9
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    Define 'another set of cells'...

    Currently.. it copies the autofiltered data from the other Workbooks to the next available row on the Master sheet..

    Where do you want the autofiltered rows copied to?

  10. #10
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    OK, yes that will work. Can I change the sheet that is copies to easily?

    Also can I change the value for just one of the workbooks?

  11. #11
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    Hi..

    Can I change the sheet that is copies to easily?
    Just change these 2 lines..

    Please Login or Register  to view this content.
    Also can I change the value for just one of the workbooks?
    Most things are possible.. but alas it is bedtime for me.. so I will look at that tomorrow..

  12. #12
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to copy data from other workbooks based on cell value

    Hi..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to copy data from other workbooks based on cell value

    Thanks man, I'll give it a try

+ 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. [SOLVED] in need of macro to copy a row of data to another sheet based on text color of one cell
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2013, 01:11 PM
  2. [SOLVED] Macro to copy across data based on a cell value
    By strud in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2013, 10:53 AM
  3. [SOLVED] Macro to copy row data based on a condition from several workbooks.
    By Ilikeideas in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 04-01-2013, 04:09 AM
  4. [SOLVED] Macro to Copy Data and Paste Values Based on cell criteria
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 06:51 PM
  5. copy dynamic ranges in multiple workbooks based on a data in 1 col
    By jbsand1001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2005, 03:06 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