+ Reply to Thread
Results 1 to 7 of 7

Copy cells by multply condition

  1. #1
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Copy cells by multply condition

    Hi everybody,

    I would like to ask your expert skill to solve a problem with VBA macro.
    I have a workbook (CTM MOD.xls, uploded). This workbook contains 3 worksheet CRITERIA, DATA, RESULT.
    I would like to collect all data (rows) in RESULT worksheet to meet the specific criterias in CRITERIA worksheet column B2:B24 and C2. In the RESULT worksheet could be copied those entire rows which is equal to CRITERIA/B2:B24 (OR) and CRITERIA/C2 (AND).

    After that it would be useful if the macro could copy the CRITRIA/A2:A24 values (according to the value of CRITERIA/B2:B24) in the RESULT/F column.

    In the RESULT worksheet I indicated the prefered result, I hope with that you can indentify more easily my goal.

    The range B2:B24 and A2:A24 can be streched beacuse i have to add more data later. The macro should investigate the range as the last cell contains data (xlDown).

    Thanks in advance for your help
    Attached Files Attached Files
    Last edited by ccsmith; 05-06-2010 at 12:38 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy cells by multply condition

    This should do it, though I seem to get a few more rows of data than you did. You can put more than one computer in column C if you wish.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Copy cells by multply condition

    That was great. It seems that it's working perfectly. I appreciate your effort. Many thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy cells by multply condition

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Copy cells by multply condition

    JBeaucaire:
    I modified your code to clear only columns A:F
    ' Sheets("Result").Range("A:F").Clear
    because in colun G there will be a multiply operation (column C * column F).
    Could it be possible to modify your macro to sorting the results by columns D; E and G in ascending order?
    Thanks in advance.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy cells by multply condition

    D is empty. But this will give you the syntax, you can adjust from there:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Copy cells by multply condition

    Thank you. I will fill up column D empty cells with 0.
    Working great.

+ 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