Consulting

Results 1 to 3 of 3

Thread: Solved: Find,MatchCase PROBLEM

  1. #1

    Question Solved: Find,MatchCase PROBLEM

    Peace to you all
    I have a code that looks for a number in a column
    The numbers in the column are not in the correct order
    332
    256
    147
    33
    158
    70
    Private Sub CommandButton1_Click()
    On Error GoTo 100
    Dim d
    Dim ra As Range
    Columns(2).Find(C, MatchCase:=True).Activate
    A = MsgBox("Do you want to delete the data", 4)
    If A = 6 Then ActiveCell.EntireRow.Delete
    Exit Sub
    100 MsgBox ("Error")
    End Sub
    the problem is
    if I want to look for number ( 33 ) the code activates (332 )the first number that has 33
    Any help 'd be greatly appreciated

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Add LookAt:=xlWhole argument to the Find.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Thanks so much
    That was great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •