I need to have an excel spreadsheet cells' fill color change when a user clicks in the cell. Can this be done. The cell contents don't change only the fill color?
Invisible buttons on each cell? a UDF? any ideas or thoughts?
TIA
Hammertime
Printable View
I need to have an excel spreadsheet cells' fill color change when a user clicks in the cell. Can this be done. The cell contents don't change only the fill color?
Invisible buttons on each cell? a UDF? any ideas or thoughts?
TIA
Hammertime
Go into the Visual Basic Editor.
Double click one of the worksheet items under "Microsoft Excel Objects".
Add this code:
Every time a cell is clicked on, that will go off and change the cell interior color to yellow.Code:Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
BTW: I should probably mention if you click and drag a range that will paint the whole range. You can make it check the range for mult-cell selections and not paint if you want to.