Hi Guys,
I have the below code where I want a macro to run when a range of cells is selected(clicked).
The code is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Sheet3.Range("Q1_COL")) Is Nothing Then
Sheet6.Range("D4").Value = Target.Value
ElseIf Not Intersect(Target, Sheet3.Range("Q2_COL")) Is Nothing Then
Sheet3.Range("N2").Value = Target.Value
If Sheet3.Range("N2").Value > 0 Then
Call MyMacro
End If
End If
End Sub
The second part is where I need the macro to run.
Just an FYI, there are two table on the sheet, hence the reason for two ranges.
I have the below code where I want a macro to run when a range of cells is selected(clicked).
The code is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Sheet3.Range("Q1_COL")) Is Nothing Then
Sheet6.Range("D4").Value = Target.Value
ElseIf Not Intersect(Target, Sheet3.Range("Q2_COL")) Is Nothing Then
Sheet3.Range("N2").Value = Target.Value
If Sheet3.Range("N2").Value > 0 Then
Call MyMacro
End If
End If
End Sub
The second part is where I need the macro to run.
Just an FYI, there are two table on the sheet, hence the reason for two ranges.