+ Reply to Thread
Results 1 to 7 of 7

Conditional formatting certain cells when another cell is highlighted

  1. #1
    Registered User
    Join Date
    08-12-2004
    Location
    Mendoza, Argentina
    MS-Off Ver
    Office Professional 2003
    Posts
    89

    Conditional formatting certain cells when another cell is highlighted

    I want to change (via conditional formatting) the background colour of cell H64 and K72 when I select / highlighted / activate (i.e. just left click in the cell) cell C66.
    I don't seem to be able to find in the formulae something to indicate if C66 is selected / highlighted /activated.

    Any pointers in the correct direction would be gratefully received.
    Last edited by thadacto; 08-21-2009 at 12:15 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formatting certain cells when another cell is highlighted

    It cannot be done with Conditional Formatting. It would require VBA coding.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-12-2004
    Location
    Mendoza, Argentina
    MS-Off Ver
    Office Professional 2003
    Posts
    89

    Re: Conditional formatting certain cells when another cell is highlighted

    And that would be way over my head, I think - I've never heard of VBA Code before!! I assume it is somewhat complicated.
    Many thnaks for the info.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formatting certain cells when another cell is highlighted

    It's not that difficult. (well some of it is )
    With your sheet, right click on sheet tab and choose "View Code" This opens up the VBA Editor
    Paste this code into the code window
    Please Login or Register  to view this content.
    Close the VBA Editor (no need to save, it's linked to your workbook).
    See if the code works. It should change H64 and K72 red
    Last edited by ChemistB; 08-21-2009 at 12:00 PM. Reason: Changed Cell colors back

  5. #5
    Registered User
    Join Date
    08-12-2004
    Location
    Mendoza, Argentina
    MS-Off Ver
    Office Professional 2003
    Posts
    89

    Re: Conditional formatting certain cells when another cell is highlighted

    Many thanks ChemistB, that works.

    I'll now work on modifying the code for the cells I want to change.

    Thanks again.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formatting certain cells when another cell is highlighted

    I corrected my code above to return to no color if another cell is selected.

  7. #7
    Registered User
    Join Date
    08-12-2004
    Location
    Mendoza, Argentina
    MS-Off Ver
    Office Professional 2003
    Posts
    89

    Re: Conditional formatting certain cells when another cell is highlighted

    I put the code in before you changed it and It worked fine.
    The edited version is perfect - thanks.
    I have some idea of coding as I write some small games using a special program and therefore do have some idea of coding.
    I'll have to investigate VBA more when I get the time.
    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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