ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   searching for values in excel and copy them to another worksheet (https://www.excelbanter.com/excel-programming/276567-searching-values-excel-copy-them-another-worksheet.html)

solo_razor

searching for values in excel and copy them to another worksheet
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Dave Ramage[_2_]

searching for values in excel and copy them to another worksheet
 
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
-----Original Message-----
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com