searching for values in excel and copy them to another worksheet

S

solo_razor

Hello,
I have a problem with vba in excel
I want to search for a value in a worksheet and then copy the data that
lies beneath it to another worksheet.

Thx
 
D

Dave Ramage

One method is as follows

Sub Demo
Dim rngR as Range

Set rngR = ActiveSheet.Cells.Find("TheText")
If rngR is Nothing Then
'value not found
MsgBox "Not Found"
Else
'get value of cell below
MsgBox rngR.Offset(1,0).Value
End If

End Sub

Look up the Find method in help to check out the various
options.

Cheers,
Dave
 

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