hendrikbez
Board Regular
- Joined
- Dec 13, 2013
- Messages
- 95
- Office Version
- 2021
- Platform
- Windows
I am new to VBA in excel
This first part of the vba code worked, but I have changed it, as when run it and have a enrty with same name on column B it show the same name that it fitst get,
so now I have make 2 columns, but doi not know how to change it
This first part of the vba code worked, but I have changed it, as when run it and have a enrty with same name on column B it show the same name that it fitst get,
so now I have make 2 columns, but doi not know how to change it
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Dest As Range
If Target.CountLarge > 1 Then Exit Sub
Set Target = Intersect(Target, Range("I:I"))
If Target Is Nothing Then Exit Sub
Set Dest = Range("B:B").Find(Target, LookIn:=xlValues, Lookat:=xlWhole)
If Dest Is Nothing Then
MsgBox Target, vbInformation, "Nie Gevind"
Else
Application.EnableEvents = False
Dest.Select
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Dest As Range
If Target.CountLarge > 1 Then Exit Sub
Set Target = Intersect(Target, Range("J:J"))
If Target Is Nothing Then Exit Sub
Set Dest = Range("E:E").Find(Target, LookIn:=xlValues, Lookat:=xlWhole)
If Dest Is Nothing Then
MsgBox Target, vbInformation, "Nie Gevind"
Else
Application.EnableEvents = False
Dest.Select
Application.EnableEvents = True
End If
End Sub