Consulting

Results 1 to 4 of 4

Thread: VBA Conditional formatting if one cell equals another cell in value

  1. #1
    VBAX Newbie
    Joined
    Jan 2010
    Posts
    2
    Location

    VBA - Highlight cell by red formatting if one cell equals another cell in value

    I am trying to colour a cell if it has the same value as another cell in a worksheet using VBA, there are several worksheets in the workbook and the number of rows can vary in the worksheets.
    I should also let it be known that the two cells in each sheet are always in the same positions for example D5 and M12,
    but the number of rows in each sheet can vary.
    I should also add that I would need to select the cells by means of starting at the active cell and going down say 1 cell and across to the left three cells to choose the first cell and then down eight cells and across seven cells to choose the second cell. It has to be this way because there are a different number of rows rows in each worksheet.

    Hopefully someone can construct some code to get the result to work in any workheet.

    Thank you.

    Richard
    Last edited by rawzone; 01-05-2014 at 10:11 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Post the workbook so that we can see what you mean.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Jan 2010
    Posts
    2
    Location

    Conditional Format

    Quote Originally Posted by xld View Post
    Post the workbook so that we can see what you mean.
    Sorry that I am late coming back to you.

    I found an alternate answer to the problem, thanks for responding.

    Regards

    Richard

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Can you post your solution so other guests with a similar problem can see the answer?

    Thanks.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •