(Solved) – We have 3 systems in our group – one system is having trouble recognizing the Excel VBA Code that searches for a number – any ideas? Thanks


Code is below: the part we are having trouble with is the Selection.Find part:
Strangest thing I have ever seen – thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim curid As String
Application.Goto Reference:="R2C2"
'curid is the id number to search for
curid = ActiveCell.Value2

  'Target Address is F1 - contains a drop down list of selections
If Target.Address = "$F$1" Then
    On Error GoTo bm_Safe_Exit
    Application.EnableEvents = False
    Select Case Target.Value2
        Case "Approved"
        'statusid is a column containing all record id numbers ranging from 1 to 115 right now
                Application.Goto Reference:="statusid"
        'this is the problem - it will not execute on one system we have
                Selection.Find(What:=curid, After:=ActiveCell, LookIn:=xlValues, LookAt _
                :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
                False, SearchFormat:=False).Activate

                ActiveCell.Offset(0, 1).Range("A1").Select
                ActiveCell.FormulaR1C1 = "Approved"
                Sheets("Update Form").Select

Leave a Reply

Your email address will not be published. Required fields are marked *