View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Excell and changing cell colour

Hi
This will make one click be yellow and double click green on sheet 1.
In the VBA editor double click sheet 1 in the Project Window. Paste in
the following:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Target.Interior.ColorIndex = 10
Cancel = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 6
End Sub

Note that the selectionChange only kicks in when you change cells, so
clicking the cell you are already on might not do anything.
You can also restrict the colour changes to a specific area on your
sheet, and not on others.
you can also make colour changes apply to all sheets in a workbook.
Post back if you need things refined a little.
regards
Paul

sadsfan wrote:
I have an interactive whiteboard, where if you touch it once this equals 1
click of the mouse and touch twice for a double click. I play a game with my
class of children which uses the mrand function from the morefunc add-in. In
the game i want to change a cell colour with one click, and change to a
different colour with a double click. Does anyone know if it is possible to
do this (the cells i want to change already have the mrand function in them)