+ Reply to Thread
Results 1 to 6 of 6

compare cells for each row

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    compare cells for each row

    Hiho,
    I want to create a script that compares the following for each row.

    I have values in column G and H.

    If the value in G > value(H)/2
    then mark cell G with a color..

    I am quite new at VBA and dont really know how to set this up

    Regards!

    / C

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: compare cells for each row

    Perhaps something like this?

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    Re: compare cells for each row

    Hey this worked, however once it changes color I can't change it back? :P
    It's like this script locks the background color to green? :P

    Quote Originally Posted by Fotis1991 View Post
    Perhaps something like this?

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: compare cells for each row

    Apologize. I missed your reply.

    ..Hey this worked, however once it changes color I can't change it back?
    What you mean saying "to change back"? When you run the macro once then in any row that the condition is correct, is highlighted.

  5. #5
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    Re: compare cells for each row

    I have another macro that should replace the color, but it can't cause it seems like the color is locked into the cell or something :P

    However, thank you very much, I have something to work from here

    Quote Originally Posted by Fotis1991 View Post
    Apologize. I missed your reply.



    What you mean saying "to change back"? When you run the macro once then in any row that the condition is correct, is highlighted.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: compare cells for each row

    This one can un-color the range..

    Please Login or Register  to view this content.
    So...

    You are welcome and thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Replies: 2
    Last Post: 09-06-2013, 02:25 PM
  2. Compare two cells, if equal move a third cells data to another cell
    By eriick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2013, 05:38 PM
  3. Replies: 6
    Last Post: 05-30-2012, 03:09 PM
  4. Compare 2 cells on sheet1 with 2 cells on sheet2 and copy unmatched rows to sheet3
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2010, 07:56 AM
  5. [SOLVED] How do I compare cells and if FALSE compare to next cell in EXCEL
    By Cindie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-24-2006, 01:35 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