I have a question for anyone; I am writing a program that will create a record in excel; I have a working program. I am having difficulties using the .findNext. Below is what I have so far (it would find the first word for me), I will like for it to find the next word if the user searches for the same word next time.

word = frmSearch.txtEnterDate.Text
If frmSearch.cboShiftSelect.Text = "1" Then
Sheets("Current").Select
Range("A1:C65536").Find(What:=word, LookAt:=xlWhole, LookIn:=xlValues, SearchOrder:=xlByColumns).Activate
'Range("A1:C65536").FindNext(After:=word).Activate

Hi

i assume this is vba, right?
i don't see the definition and/or assignment of the variable "word"
try this

dim word as string
word = "xxx"
Cells.Find(What:=word, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False).Activate


Cells.FindNext(After:=ActiveCell).Activate

the first line will find the word "xxx":
the second one will find the next one.

so make a global counter increase it everytime the user runs the macro, and then search as many times as the counter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.