Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error Resume Next
If Not Intersect(Target, Range(ActiveCell.Address)) Is Nothing Then
ActiveCell.Value = ActiveCell.Value + 1
Cancel = True
This article will show you method of add 1 to a cell value automatically with double clicking it in Excel.
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 71% of your time and solve 82% Excel problems for you. 300+ advanced tools designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial
The following VBA code can help you add 1 to a cell value after double clicking. Please do as follows.
1. Right click the sheet tab which the cell values you need to add 1 with double clicking. Then click View Code from the right-clicking menu.
2. In the popping up Microsoft Visual Basic for Applications window, copy and paste the below VBA code into the Code window.
VBA code: Add 1 to a cell value with double clicking
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) On Error Resume Next If Not Intersect(Target, Range("A1")) Is Nothing Then Range("A1").Value = Range("A1").Value + 1 Cancel = True End If End Sub
Note: In the code, A1 is the cell you will add number 1 to with double clicking.
3. Press the Alt + Q keys simultaneously to close the Microsoft Visual Basic for Applications window.
Now, double click on cell A1 will add 1 to the existing value as below screenshot shown.