+ Reply to Thread
Results 1 to 3 of 3

Highlight cell upon selection

Hybrid View

  1. #1
    Registered User
    Join Date
    03-24-2006
    Posts
    45

    Highlight cell upon selection

    Hello,

    I would like a cell's fill colour to change upon selection. E.g., Clicking on the cell makes it grey. Clicking on it a second time makes it white again. (i.e., click cell, if current fill is white, set fill to grey, else set to fill to white).

    I'd really appreciate your help. Thanks.

  2. #2
    Registered User
    Join Date
    03-24-2006
    Posts
    45

    Re: Highlight cell upon selection

    Alternatively, if I were to mask the cell as a toggle button, where selecting the cell (i.e., button) would make it a default BackColor when the value is true, then that might be another option...

  3. #3
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    922

    Re: Highlight cell upon selection

    You could try to work around something like this placed in the sheets code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If ActiveCell.Interior.ColorIndex = 44 Then
            ActiveCell.Interior.ColorIndex = xlNone
        Else
            ActiveCell.Interior.ColorIndex = 44      '6=yellow  3=red 
        End If
        Cells.Borders.LineStyle = xlLineStyleNone
        ActiveCell.Borders.LineStyle = xlContinuous
    End Sub
    Last edited by rollis13; 04-24-2012 at 05:14 PM.

+ 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