+ Reply to Thread
Results 1 to 13 of 13

copy rows from multiple worksheets to a new condition based on criteria

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    copy rows from multiple worksheets to a new condition based on criteria

    hello, i'm new to the forum and need your help:
    here is the problem:
    I have multiple sheets with the same format.(all columns have same format)
    in column "A" i have a value lets say "B1-1".
    what i need to do is to copy from all sheets the rows containing in column "A" the same criteria("B1-1") to a new sheet and skip the rows that have a blank cell in Column "A" i appreciate your help in advance
    hope the problem explanation is clear.

  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: copy rows from multiple worksheets to a new condition based on criteria

    Try this code
    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 View | Macros
    Select a macro in the list, and click the Run button
    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
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: copy rows from multiple worksheets to a new condition based on criteria

    in attachment my file, the result that i would like to see is in Sheet 10.
    thanks for your help in advance
    Attached Files Attached Files

  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: copy rows from multiple worksheets to a new condition based on criteria

    You said your text B1-1 was in column A, but in this attachment, the B1-1 is in column F.

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

    Re: copy rows from multiple worksheets to a new condition based on criteria

    Updated code
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: copy rows from multiple worksheets to a new condition based on criteria

    wow thanks you saved my intelligence.
    you are right but in the example i tried to make it more clear with a real example
    thanks again

  7. #7
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: copy rows from multiple worksheets to a new condition based on criteria

    another question.
    if i want to have successive listings?
    this means B1-1 ten B1-2 etch all on the same worksheet divided by an empty row what should i add?
    thanks in advance

  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: copy rows from multiple worksheets to a new condition based on criteria

    How many such B1-? can you have? I mean whats the last number?

  9. #9
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: copy rows from multiple worksheets to a new condition based on criteria

    well i have up to 125
    example
    B1-1 to B1-125
    B2-1 to B2-125
    but actually i can select the condition (for example B1-1) from a dropdown list with this assumption:
    Please Login or Register  to view this content.
    Last edited by arlu1201; 11-20-2012 at 01:31 PM. Reason: Use code tags when posting code.

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

    Re: copy rows from multiple worksheets to a new condition based on criteria

    Yeah thats a good idea. Why dont you include the dropdown and upload your file so i can give you the updated code for it?

  11. #11
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: copy rows from multiple worksheets to a new condition based on criteria

    the file is too big and it would take time to clear it up,
    here the actual code with the dropdown list and a header copy function:
    Please Login or Register  to view this content.
    Last edited by arlu1201; 11-20-2012 at 02:23 PM. Reason: Please use code tags in future as per forum rule 3.

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

    Re: copy rows from multiple worksheets to a new condition based on criteria

    Is it working? Its good you were able to do it yourself, where would the dropdown be? In which tab?

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

    Re: copy rows from multiple worksheets to a new condition based on criteria

    Your code can be made better like this-
    Please Login or Register  to view this content.
    Change highlighted text as per your file.

+ 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