new comer problems

  • Thread starter Thread starter Eitan
  • Start date Start date
E

Eitan

Hi,

I am new to the Excell environment. I am trying to use the find method
from a visual basic program and i want to start the search after a
given cell. The code is something like this


Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)

The address i have from which I want the search to begin is a result
of a previous search. specifically it is c.address (the same c that
appears in the code). I didn't succeed to use this address as the
after parameter for the next find. How can i use this address? I am
sure I am doing something wrong but I just don't know what.

Thanks for the help.
 
maybe
Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole

Sub findafter()
strItemCode = "a"
With ActiveSheet
Set c = .Columns(2).Find(strItemCode, after:=Range("b2"))
End With
MsgBox c.Address
End Sub
 
Try this:

Private Sub FindItAfter_C_Address()
Set c = Cells.Find(what:=strItemCode, _
after:=c.Address, LookIn:= xlValues, _
LookAt:=xlWhole, Searchorder:=xlByRows)
End Sub

-IA
 
dim sAddr as String, c as Range
With ActiveSheet
set c =.Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)
if not c is nothing then
sAddr = c.Address
Do
c.Interior.colorindex = 5
set c = .Range("b2").EntireColumn.FindNext(c)
Until c.Address = sAddr
End if
End with
 
Back
Top