atferrari Well-Known Member Most Helpful Member Jan 28, 2011 #1 I forgot long time ago the little I knew of VB applied to Excel. Can anyone give a snippet of VB code to get the value in cell C8 to increase by n every time I click the mouse on cell C9 ? I recall that being possible but I am clueless now. Gracias for any help.
I forgot long time ago the little I knew of VB applied to Excel. Can anyone give a snippet of VB code to get the value in cell C8 to increase by n every time I click the mouse on cell C9 ? I recall that being possible but I am clueless now. Gracias for any help.
P Pommie Well-Known Member Most Helpful Member Jan 28, 2011 #2 You can do it on Right Click, Code: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Target.Row = 9 And Target.Column = 3 Then Cells(8, 3) = Cells(8, 3) + 1 Cancel = True End If End Sub This must be in the sheets VB code. Mike.
You can do it on Right Click, Code: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Target.Row = 9 And Target.Column = 3 Then Cells(8, 3) = Cells(8, 3) + 1 Cancel = True End If End Sub This must be in the sheets VB code. Mike.
atferrari Well-Known Member Most Helpful Member Jan 28, 2011 #3 Mike, Helpful as usual! Gracias. I forgot even how to insert that code in Excel. Can you help as well?
Mike, Helpful as usual! Gracias. I forgot even how to insert that code in Excel. Can you help as well?
P Pommie Well-Known Member Most Helpful Member Jan 28, 2011 #4 Here ya go. Open it and press Alt-F11. Tut, .xls not allowed. So I renamed it .txt Mike. Attachments clicky.txt 19 KB · Views: 434
atferrari Well-Known Member Most Helpful Member Jan 28, 2011 #5 Thanks Pommie. Managed to program two cells to bring the value up and down. Oh God, how rusty I am in all this!
Thanks Pommie. Managed to program two cells to bring the value up and down. Oh God, how rusty I am in all this!