+ Reply to Thread
Results 1 to 6 of 6

How to equal two cells if they have different values

  1. #1
    Registered User
    Join Date
    10-05-2018
    Location
    Athens,Greece
    MS-Off Ver
    Office 365
    Posts
    7

    How to equal two cells if they have different values

    I have a database with some systems. I have made a marco that loop through the data and if they meet certain criteria are copied to differenct sheet. Something like this

    Please Login or Register  to view this content.
    My problem is that cell G2 might have the word "marine" and the cells N can have one of the words "all", "marine", "brackish". I want,for example, the word "marine" to be included in the word "all" so that the macro will select the system that have the word all if the criteria is marine.

    I hope I explained it correctly.
    Last edited by mariosex; 10-09-2018 at 12:54 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,945

    Re: How to equal two cells if they have different values

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,423

    Re: How to equal two cells if they have different values

    Maybe like this
    Please Login or Register  to view this content.
    Last edited by daboho; 10-09-2018 at 07:55 PM.

  4. #4
    Registered User
    Join Date
    10-05-2018
    Location
    Athens,Greece
    MS-Off Ver
    Office 365
    Posts
    7

    Re: How to equal two cells if they have different values

    I am not sure if this is what I am looking. Maybe I didn't express it correctly. To make it more clear.
    The cell G2 has the world "marine"
    The cells in column N has one of these words: "marine", "all", "brackish"
    For example N4="marine" , N5="all"
    I want that if the code finds the word "all" to match it with criteria "marine"
    Last edited by alansidman; 10-10-2018 at 12:03 AM.

  5. #5
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,423
    Still not understand what you want,give sample workbook or picture
    Maybe from this coding can you modifay
    Please Login or Register  to view this content.
    Last edited by alansidman; 10-10-2018 at 12:04 AM.

  6. #6
    Registered User
    Join Date
    10-05-2018
    Location
    Athens,Greece
    MS-Off Ver
    Office 365
    Posts
    7

    Re: How to equal two cells if they have different values

    Here are images from my workbook
    sheet1(database).PNG
    sheet2(results).PNG

    At sheet1 I have the database and at sheet2 I have the criteria. I want to paste from sheet1 to sheet2 the systems that meet these criteria. I have managed to do it with the numeric data but I have problem with the linguistic data because I want, for example, the world "marine" to be included in the world "all" and when the code finds the world "all" to select the system if the criteria is "marine".
    Last edited by mariosex; 10-10-2018 at 02:06 PM.

+ 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] Macro to check values on two cells should be equal
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-04-2014, 09:07 AM
  2. Multiple Cells values - formula to see which cells added together equal zero?
    By rodders0223 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-15-2013, 11:09 AM
  3. [SOLVED] Compare iF cells has equal values then.............
    By Oceans in forum Excel General
    Replies: 9
    Last Post: 11-07-2012, 09:13 AM
  4. [SOLVED] If cells Values are equal..........then
    By Oceans in forum Excel General
    Replies: 2
    Last Post: 11-07-2012, 05:47 AM
  5. [SOLVED] Skip loop if cells equal same values
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-02-2012, 01:19 PM
  6. Matching cells with equal values
    By LukeBhatia in forum Excel General
    Replies: 4
    Last Post: 09-14-2011, 11:19 AM
  7. checked the equal values from cells
    By kar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2006, 04:48 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