+ Reply to Thread
Results 1 to 6 of 6

VBA that compares two cells and returns an indicator

  1. #1
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    VBA that compares two cells and returns an indicator

    Hi again,

    I want to make a VBA that checks if:
    sheet "Q214",cell A1 has values.
    If it has values then compares it with the value in sheet "Q114", Cell A1.

    IF Q214>Q114, then ↗
    IF Q214=Q114, then ↔
    IF Q214<Q114, then ↘

    The symbol should be in sheet"Q214" cellB1.

    Then do the same in A2, A3, A4 and so on.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    re: VBA that compares two cells and returns an indicator

    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    Re: VBA that compares two cells and returns an indicator

    Hi,

    Thanks - this is a good start!

    However:
    - I want the arrows to be dynamic - the user is going to put in values at a later stage. This can make the arrows change direction.
    - Now the macro puts in arrows without taking into concern that the cell contains value, which makes it compare to empty cells.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA that compares two cells and returns an indicator

    Please paint a complete picture and be specific about the project you're trying to accomplish. Once we have all the information we can rework it.

  5. #5
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    Re: VBA that compares two cells and returns an indicator

    Ok - I'll try again:

    I want to make a VBA that checks if:
    sheet "Q214",cell A1 has values.
    If it has values then compares it with the value in sheet "Q114", Cell A1.

    IF Q214>Q114, then ↗
    IF Q214=Q114, then ↔
    IF Q214<Q114, then ↘

    The symbol should be in sheet"Q214" cellB1.
    If the cell doesn't have values, then nothing should be written.
    The user must also be able to change values without running the macro again. Change of values could change direction of the arrows.

    Then do the same in A2, A3, A4 and so on.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA that compares two cells and returns an indicator

    Place this in the Q114 sheet module.

    Please Login or Register  to view this content.

+ 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. IF Statement that compares multiple cells and gives me the lowest number
    By williamfrus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2012, 07:37 PM
  2. Replies: 0
    Last Post: 08-17-2011, 10:09 AM
  3. Macro compares adjacent cells to produce an index
    By PotterHarry in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-01-2010, 04:56 PM
  4. [SOLVED] Function that compares dates and returns TRUE or FALSE
    By Emily in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2006, 04:30 PM
  5. Formula indicator in cells???
    By Bob Newman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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