Hey
Here is a good search code, that I have picked up, the problem is that when other colleagues press on column A by mistake it brings up an error which opens Visual Basic, I cant think why it is doing this if you press on column A at any point before of after a search.
My users are not great excel users and are getting confused when VB opens.
Does anyone know how I can stop this?
Thanks
Here is a good search code, that I have picked up, the problem is that when other colleagues press on column A by mistake it brings up an error which opens Visual Basic, I cant think why it is doing this if you press on column A at any point before of after a search.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Found As Range, ws As Worksheet
Dim sht As String, oAd As String
If Not Target.Column = 1 Then Exit Sub
Set Found = Target.Find(What:="$")
If Found Is Nothing Then
MsgBox "Invalid Address", vbExclamation
Else
sht = Split(Target.Value, " ")(0)
oAd = Split(Target.Value, " ")(1)
Sheets(sht).Select
ActiveSheet.Range(oAd).Select
End If
End Sub
My users are not great excel users and are getting confused when VB opens.
Does anyone know how I can stop this?
Thanks