+ Reply to Thread
Results 1 to 25 of 25

Copy various fields from one workbook to various fields in another by criteria

  1. #1
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Copy various fields from one workbook to various fields in another by criteria

    Hi

    I have a sheet that is extracted from an application. Column 1 of the extracted sheet has "F numbers". I need code that can copy all the same "F numbers" and the entire row of said "F numbers" to certain blocks in my master sheet.

    For instance, there is 6 instances of F4I in the extracted sheet, so I need all those rows to be copied to the first block in my master sheet and there is 3 F4D's which then needs to copy to the second block in my master sheet and so on....

    I need this to work as a add - in where when the user has extracted the data sheet from the application and then press a add-in button it populates the master sheet.

    The "F numbers" will differ each time that I extract the data to excel sheet from my application. The extracted sheet will have a different name each time as the application where it is extracted automatically names it with the area prefix and the current date.

    The blocks that I refer to above in the master sheet is : block1 = A2:O21 block2 = A23:O42 and so on...
    Attached Files Attached Files

  2. #2
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  3. #3
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  4. #4
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  5. #5
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  6. #6
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Is this even possible?

  7. #7
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  8. #8
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  9. #9
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  10. #10
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  11. #11
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  12. #12
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  13. #13
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  14. #14
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  15. #15
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  16. #16
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    bump no reply

  17. #17
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    bump no reply

  18. #18
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  19. #19
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    bump no reply

  20. #20
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  21. #21
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  22. #22
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Bump no reply

  23. #23
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    Hi

    I found the code below(thanks Ron de Bruin). not sure if this will help. I can't get it modified to work for me and this code will have to loop somehow...
    Please Login or Register  to view this content.
    the code gets stuck here :
    Please Login or Register  to view this content.
    before this runs I have a macro that runs to copy all the "Fnumbers" to A400 and then removes duplicates, so I only have the unique "fnumbers" left. Then the code above has to loop and do it's thing filtering by A400 and copying to A2 in the master sheet, then it must filter by A401 and copy that data to A23 in the master sheet and then A402 to 44 etc. etc.

    Hope this will help you help me with this problem

  24. #24
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    sorry, never mentioned what the error is when it gets stuck. it highlights .range and gives the error :
    Compile error :
    method or data member not found

    the code uses the lastrow function which I have set to A2 as below.....don't know if this is relevant???
    Please Login or Register  to view this content.

  25. #25
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Copy various fields from one workbook to various fields in another by criteria

    tried another approach, but the code is very long. please could someone help to loop through the "copyfnumber" sections. I know how to loop, but have no clue how to loop if the criteria range has to change with every loop and the paste to range has to change with every loop. here is the working code that needs to loop :
    Please Login or Register  to view this content.

+ 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] How to put restricted areas or fields on same workbook until filing some fields first?
    By dreammaker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2012, 05:17 AM
  2. Copy Excel data to Word fields and retain fields
    By GCW esq in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-06-2012, 10:31 AM
  3. Macro to copy accross several fields from one workbook into another
    By josanba in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2012, 08:20 AM
  4. read txt(csv) file with 68 fields and copy 6 fields to new workbook.
    By gosa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-27-2011, 07:14 AM
  5. How to Disable automatic fields in pivot table like total and count on fields
    By anushka in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2009, 07:53 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