+ Reply to Thread
Results 1 to 5 of 5

Copy rows from one sheet to another based on 2 conditions

  1. #1
    Registered User
    Join Date
    05-13-2010
    Location
    Marion, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    43

    Cool Copy rows from one sheet to another based on 2 conditions

    I am looking to copy data from one sheet to another based on the value in a to columns. If column "N" contains "WDWO" and if "I" is less than "600" then I need to move three fields in that row to a different sheet. the fields that need to be moved are in columns a, e, j. I have attached a sample of the sheets before and after. My original sheet is sheet 1 and my filtered sheet is sheet 2. As always thanks ahead for the help and it is much appreciated! And I need this in a macro so I can automate this process because I have to do this with 8 different sheets.
    Attached Files Attached Files
    Last edited by chrispulliam; 05-22-2010 at 07:13 PM. Reason: Add more to post

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,621

    Re: Copy rows from one sheet to another based on 2 conditions

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    05-13-2010
    Location
    Marion, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Copy rows from one sheet to another based on 2 conditions

    I tried this on my original sheet and i get a Run time error 13 type mismatch on the following line of code
    Please Login or Register  to view this content.
    but I look over at my sheets and some data is populating. I dont understand what is going wrong. Been trying this for about 1 hour and a half to tweek and figure out what is happening. Any ideas?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,621

    Re: Copy rows from one sheet to another based on 2 conditions

    How is your actual sheet different from the sample? May need a bigger sample including data that you think is causing the problems.
    Attached Files Attached Files
    Last edited by protonLeah; 05-22-2010 at 11:41 PM.

  5. #5
    Registered User
    Join Date
    07-29-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Copy rows from one sheet to another based on 2 conditions

    I'm guessing the mismatch is at your less-than comparison. You're probably trying to compare a number with a non-number (i.e., a " ", a null, a letter).

    Try testing the values before comparing using isnumeric(number to test) like this:

    if isNumeric(number to test) then
    'number is numeric, do nothing
    else
    'not numermic!
    msgbox "this number can't be compared to other numbers: " & activecell.address

    end if

+ 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