Tecnik
11-17-2006, 05:28 AM
Hi there,
I'm trying to create a procedure that fires when a user clicks a cell, it could be any cell, hence the need for some sort of onClick event.
When clicked the cell changes colour say from white to yellow. If the cell is already yellow it changes back to white.
Here's my code so so far, I've been trying to 'put it in the right place' but I'm still having problems.
' toggle cell colour
If ActiveCell.Interior.ColorIndex = 0 Then
ActiveCell.Interior.ColorIndex = 6 ' Yellow
Else
ActiveCell.Interior.ColorIndex = 0 ' No fill
End If
I know I once found a nice example for this but can't think where I put it.
Please can someone help, or point me in the right direction.
Thanks in advance,
Nick
I'm trying to create a procedure that fires when a user clicks a cell, it could be any cell, hence the need for some sort of onClick event.
When clicked the cell changes colour say from white to yellow. If the cell is already yellow it changes back to white.
Here's my code so so far, I've been trying to 'put it in the right place' but I'm still having problems.
' toggle cell colour
If ActiveCell.Interior.ColorIndex = 0 Then
ActiveCell.Interior.ColorIndex = 6 ' Yellow
Else
ActiveCell.Interior.ColorIndex = 0 ' No fill
End If
I know I once found a nice example for this but can't think where I put it.
Please can someone help, or point me in the right direction.
Thanks in advance,
Nick