KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 453
- Office Version
- 2016
- Platform
- Windows
Hi every one
Can you combine these 2 VBA codes, so when I press cell in column J it shot run the first VBA-code and when I press in the cells in column K it shot run the secund VBA-code.
Some who can help.
Any help will be appreciated
Best Regards
Klaus W
Can you combine these 2 VBA codes, so when I press cell in column J it shot run the first VBA-code and when I press in the cells in column K it shot run the secund VBA-code.
Some who can help.
Any help will be appreciated
Best Regards
Klaus W
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Code 1
If Selection.Count = 1 Then
If Not Intersect(Target, Range("J2:J41")) Is Nothing Then
Range("ab16").Value = Target.Offset(0, -9).Value
Target.Value = "S"
End If
End If
End Sub
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Code 2
If Selection.Count = 1 Then
If Not Intersect(Target, Range("k2:k41")) Is Nothing Then
Range("ab18").Value = Target.Offset(0, -10).Value
Target.Value = "G"
End If
End If
End Sub