View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default Find Text String

Hi All,

Thanks for your quick reply and your codes

Ozgrid, thanks for your reference of website

JL, yes! you are right and this is the codes that I'm looking for
However, after I work around based on the suggested codes provided by
JL, there is no response
Then I try to modify the codes as follows and it is not completely
worked, please help

Dim WB As Workbook, sh As Worksheet
Dim i As Integer
Set WB = Workbooks("ABC.xls")
Set sh = ActiveSheet
With WB
For i = 2 To sh.Range("C" & Rows.Count).End(xlUp).Row
If InStr(sh.Cells(i, 3), "HA") = 0 Then
x = x + 1
End If
If InStr(sh.Cells(i, 3), "HVB") = 0 Then
y = y + 1
End If
If x = 0 Then
MsgBox "HA Not Found"
Exit Sub
Else
x = 0
End If
If y = 0 Then
MsgBox "HVB Not Found"
Exit Sub
Else
y = 0
End If

Next i
End With

Thanks & Regards
Len