It might be easier you separate out the double-click code and then call the routine from both events.
So in Sheet1
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Call Sheet1DoubleClick(Target, Cancel)
End Sub
Sub Sheet1DoubleClick(ByVal Target As Range, Cancel As Boolean)
calc = Application.Calculation
Application.Calculation = xlCalculationManual
With Sheet1
Set Target = .Range(Target.Address)
.Cells(5, "B") = .Cells(5, "B") + .Cells(16, "B")
Cancel = True
.Cells(5, "A") = .Cells(5, "A") + .Cells(13, "A")
Cancel = True
.Cells(8, "A") = .Cells(8, "A") + .Cells(21, "AD")
Cancel = True
.Cells(10, "B") = .Cells(10, "B") + .Cells(13, "B")
Cancel = True
.Cells(5, "C") = .Cells(5, "C") + .Cells(15, "C")
Cancel = True
.Cells(10, "C") = .Cells(10, "C") + .Cells(16, "D")
Cancel = True
.Cells(5, "D") = .Cells(5, "D") + .Cells(13, "C")
Cancel = True
.Cells(8, "C") = .Cells(8, "C") + .Cells(15, "D")
Cancel = True
End With
Application.Calculation = calc
End Sub
Then in Sheet2
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Call Sheet1.Sheet1DoubleClick(Target, Cancel)
End Sub
Bookmarks