Results 1 to 6 of 6

Thread: Remove conditional formatting on cell focus

  1. #1
    Seeker lee2121's Avatar
    Join Date
    Sep 2018
    Posts
    11
    Articles
    0
    Excel Version
    Office 365

    Remove conditional formatting on cell focus



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Is it possible to remove conditional formatting from a cell when the user enters the cell and changes the value?

    Struggling to find a way of doing this any help would be appreciated.

  2. #2
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    711
    Articles
    0
    Excel Version
    Excel 2010 64bit
    Have you tried using the worksheet_change event on the sheet module ?
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        Target.FormatConditions.Delete
    End Sub

  3. #3
    Seeker lee2121's Avatar
    Join Date
    Sep 2018
    Posts
    11
    Articles
    0
    Excel Version
    Office 365
    Tried and nothing happens, the conditional formatting remains in place. I'm trying to do this on a range of cells so whn any cell within the range is clicked in (focus) then the conditional fromatting for that cell only is cleared.

    thanks.

  4. #4
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    711
    Articles
    0
    Excel Version
    Excel 2010 64bit
    I would guess you don't have the code on the sheets' module.
    Right click on the sheet tab for the sheet you want it to operate on and select view code.

    http://www.globaliconnect.com/excel/...=79&Itemid=475

  5. #5
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    711
    Articles
    0
    Excel Version
    Excel 2010 64bit
    ... on a range of cells so whn any cell within the range is clicked in (focus) then the conditional fromatting for that cell only is cleared.
    This is not the same as your original request which indicated a change of value.
    Without going into the guts of Excel you can't determine if the cell got focus by mouse click, enter key or tab key.
    Maybe double clicking in a cell could be more applicable.

  6. #6
    Seeker lee2121's Avatar
    Join Date
    Sep 2018
    Posts
    11
    Articles
    0
    Excel Version
    Office 365
    Thank you i have this working now as i actually need the formatting to be removed when the cell has been changed, your code works great.

Posting Permissions

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