Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004

    Unanswered: This should be easy... Excel cell compare

    I need to search a spreadsheet one column ata atime looking for specific values in each column. If the value exista at all, I need a value set to true. This is what I have...

    bOK = False
    For bp = 1 To intRowRange
    If Cells(bp).Value = "60" Then
    bOK = True
    Exit For
    End If
    Next bp

    It processes, but I do not think it is searching clomn I like it is supposed to because the value 60 does exist and yet the boolean value is still returned as false. Any way I can make this work?

  2. #2
    Join Date
    Jan 2004
    Aberdeen, Scotland

    Re: This should be easy... Excel cell compare

    Hi Bill

    I dont know if this is the best way to do this or not but this routine will work

        Lastrow = Range("A1").End(xlDown).Row
    bok =false
        For I = 1 To Lastrow
            If ActiveCell.Formula = "60" Then
                bok = True
                Exit For
            End If
            ActiveCell.Offset(1, 0).Select
        Next I
    ive tested this and it finds the value the only assumption ive made is that all your rows in column A are filled up till the last row of data i hope this is of some help to you

  3. #3
    Join Date
    Jan 2004
    The Netherlands
    For one thing you should search for 60 (number) not "60" text.

Posting Permissions

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