Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
Hi, I need help to run a marco by double clicking a cell in E column to run a marco but this can only be implemented if the both Cell A and B in same row is not empty. Below is my code
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Range("A:B" & Rows.Count).Value <> 0 Then
Range("E" & Rows.Count).Activate
End If
If Not Intersect(Target, Range("E" & Rows.Count)) Is Nothing Then
Cancel = True
Call Module8.SelectOLE
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Range("A:B" & Rows.Count).Value <> 0 Then
Range("E" & Rows.Count).Activate
End If
If Not Intersect(Target, Range("E" & Rows.Count)) Is Nothing Then
Cancel = True
Call Module8.SelectOLE
End If
End Sub