Hello all!
Hopefully you can help with this. I am working on a form that needs to be interactive for the user. It has three columns of possible answers to certain questions. So far I have been able to code the form to highlight in yellow (ColorIndex=6) the selected answer based on a double click to highlight and right click to remove highlight.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 6
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 0
End Sub
What I need to do now is assign a point value to the answers so that the points can be tallied in a fourth column.
For example if the answers in column A, B, C are worth 5pts, 3pts and 1pt respectively then when either A,B and/or C is highlighted, the total value in column D would be "5" or "3" or "1" or if all three are selected then the point total in column D would obviously be "9".
I've gotten this far by using columns over to the right (columns AC,AD,AE) in my work sheet:
=IF(ColorIndex($A$1)=6,"5","0")
=IF(ColorIndex($A$2)=6,"3","0")
=IF(ColorIndex($A$3)=6,"1","0")
Which if this worked the way it was supposed to, I could then simply SUM up the rows and there you have it. My problem is that when I highlight or "de-highlight" cells, it does not automatically update the values in AC,AD or AE.
I actually have to click on the formula in these cells individually and press enter before they'll update.
How do I get this to function automatically?
Thanks
MJ
Hopefully you can help with this. I am working on a form that needs to be interactive for the user. It has three columns of possible answers to certain questions. So far I have been able to code the form to highlight in yellow (ColorIndex=6) the selected answer based on a double click to highlight and right click to remove highlight.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 6
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 0
End Sub
What I need to do now is assign a point value to the answers so that the points can be tallied in a fourth column.
For example if the answers in column A, B, C are worth 5pts, 3pts and 1pt respectively then when either A,B and/or C is highlighted, the total value in column D would be "5" or "3" or "1" or if all three are selected then the point total in column D would obviously be "9".
I've gotten this far by using columns over to the right (columns AC,AD,AE) in my work sheet:
=IF(ColorIndex($A$1)=6,"5","0")
=IF(ColorIndex($A$2)=6,"3","0")
=IF(ColorIndex($A$3)=6,"1","0")
Which if this worked the way it was supposed to, I could then simply SUM up the rows and there you have it. My problem is that when I highlight or "de-highlight" cells, it does not automatically update the values in AC,AD or AE.
I actually have to click on the formula in these cells individually and press enter before they'll update.
How do I get this to function automatically?
Thanks
MJ