FindNext

J

John Keturi

Need help finishing code(??????). Once it finds "c", I want to paste that
value in cell "C4", but then PAUSE, and wait for user input. If the user
selects "next", then loop to find the next "c". Thanks

Sub Find()
Dim myValue As Range
Set myValue = Range("C5")
With Worksheets(1).Range("a1:a100")
Set c = .Find(myValue, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.????????
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
 
S

Sharad Naik

How about this, in place of c.????? ?

y = MsgBox("Do you want to find next 'c' ?", vbYesNo, "Hello there")
If y = vbYes Then Exit Do

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top