find ????

S

solo_razor

hi

I have implemented a find option to search for a particular string, if
found then copy the data what lies under it to a certain row lets say
row 500 and then copy, does anybody know vba code for this.

Regards,
 
S

shockley

Something like:

Dim rngFind As Range
Dim sString As String

sString = "abcd"

Sub Tester()
Set rngFind = Cells.Find(What:=sString, LookAt:=xlPart)
If Not rngFind Is Nothing Then
Cells(500, 3) = rngFind
End If
End Sub

Not sure what you mean by copy a string to a row. If you mean put the
string in every cell in Rows(500)
you could do this with

Rows(500) = rngFind

HTH,
Shockley
 

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