Hi everone!!
I have following code (code1) in my excel sheet and I want this same processed to be run in the same sheet in two different places for two different purpose (for 2 different set of data)
Code 1 is working well, when I try to develop code-2 (as smellier to code1) it seems not working. Please advice me ,,
How should I modify code2 to make it work.
(FYI- each code has 4 different name range)
Thanking you,,,
Code 1
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(ActiveCell, [plstProduct]) Is Nothing Then
[valProductPick] = ActiveCell.Value
ElseIf Not Application.Intersect(ActiveCell, [plstCategory]) Is Nothing Then
[valCategoryPick] = ActiveCell.Value
End If
End Sub
Code 2
Private Sub Worksheet_SelectionChange2(ByVal Target As Range)
If Not Application.Intersect(ActiveCell, [plstProduct2]) Is Nothing Then
[valProductPick2] = ActiveCell.Value
ElseIf Not Application.Intersect2(ActiveCell, [plstCategory2]) Is Nothing Then
[valCategoryPick2] = ActiveCell.Value
End If
End Sub
I have following code (code1) in my excel sheet and I want this same processed to be run in the same sheet in two different places for two different purpose (for 2 different set of data)
Code 1 is working well, when I try to develop code-2 (as smellier to code1) it seems not working. Please advice me ,,
How should I modify code2 to make it work.
(FYI- each code has 4 different name range)
Thanking you,,,
Code 1
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(ActiveCell, [plstProduct]) Is Nothing Then
[valProductPick] = ActiveCell.Value
ElseIf Not Application.Intersect(ActiveCell, [plstCategory]) Is Nothing Then
[valCategoryPick] = ActiveCell.Value
End If
End Sub
Code 2
Private Sub Worksheet_SelectionChange2(ByVal Target As Range)
If Not Application.Intersect(ActiveCell, [plstProduct2]) Is Nothing Then
[valProductPick2] = ActiveCell.Value
ElseIf Not Application.Intersect2(ActiveCell, [plstCategory2]) Is Nothing Then
[valCategoryPick2] = ActiveCell.Value
End If
End Sub
Last edited: