• FIND only 4 left part of cells (2000)

    Author
    Topic
    #456682

    i use this line to find in column O the value SERV…

    Set Found_INDEX = WS.Columns(“O:O”).Find(SERV, LookIn:=xlFormulas, LookAt:=xlWhole)

    But is possible to find SERV only in left,4 of cells in column O?
    Example:

    SERV=4500
    in column O 4500-aaaaaaaaa

    Viewing 2 reply threads
    Author
    Replies
    • #1142002

      If SERV will only ever appear as the first 4 characters, you could simply use:
      Set Found_INDEX = WS.Columns("O:O").Find(SERV, LookIn:=xlFormulas, LookAt:=xlPart)

    • #1142009

      Could you not make use of Data > Filter > Custom > Begins with?

    • #1142428

      If SERV is a variable,

      With WW.Columns(“O:O”)
      Set Found_Index = .Cells(Application.Match(SERV & “*”, .Cells, 0), 1)
      End With

      If “SERV” is the string you want to match,

      With WW.Columns(“O:O”)
      Set Found_Index = .Cells(Application.Match(“SERV*”, .Cells, 0), 1)
      End With

    Viewing 2 reply threads
    Reply To: FIND only 4 left part of cells (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: