Sure a Vba script can be activate using a Double Click.
But we do not need to use Conditional formatting.
So when you double click on A1 for example what do you want to happen.
Tell me where you want to double click and when you do so what do you want to happen.
Here is a example of a Double Click Script.
If you double click on any cell in column A if the value in the cell is 2 the cell color will be Blue
If you double click on any cell in column A if the value in the cell is 5 the cells color will be Red
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified 8/16/2019 3:07:17 AM EDT
If Target.Column = 1 And Target.Value <> "" Then
Cancel = True
Select Case Target.Value
.ColorIndex = 5
.ColorIndex = 3
Thank you so much for trying to help me.
I pasted your macro in a blank worksheet, but it didn't work...not sure what I am doing wrong...
I have written 4 macros, to change the color of the fill for a cell based on the user's needs (it is part of a game). However, I thought it would be easier to have the user double click and depending on the cell address with a vlookup, will change the cell to the right color.