Results 1 to 6 of 6

How to equal two cells if they have different values

Threaded View

  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

    lrow = Sheets("database").Range("database").Rows.Count + 1
    For i = 3 To lrow
      If Sheets("Database").cells(i, "J").Value >= Sheets("Results").Range("C2").Value And _
         Sheets("Database").cells(i, "K").Value <= Sheets("Results").Range("D2").Value And _
         Sheets("Database").cells(i, "L").Value <= Sheets("Results").Range("E2").Value And _
         Sheets("Database").cells(i, "N").Value = Sheets("Results").Range("G2").Value Then
         Worksheets("Database").Rows(i).EntireRow.Copy
         Worksheets("Results").Range("I" & i + 12).End(xlUp).Offset(1, -8).PasteSpecial xlPasteValuesAndNumberFormats
    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.

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