using .find to get me a row

A

andycharger

Hi,

someone suggested to me that I use .find on a range so I can find a ro
and do some editing.

However, the statement I have returns me the value of one cell and
now want to select that entire row.

Can someone help?

Here is the code:

Dim Searcht as Worksheet
Dim Searchrange as range
Dim Foundrange As Range

Set Searchsht = Worksheets ("YourSheet")

Set Searchrange = Searchsheet.Columns(1)
With Searchrange

For RowDates = Range("A1").End(xlDown).Row To 2 Step -1

strRef = Cells(RowDates, "A").Value
StrYes = Cells(RowDates, "B").value

set Foundrange = nothing
Set Foundrange = .Find( strRef, LookIn:=xlValues)
'**********************************************
'* here is where I guess I need to get the entire row once its found
'********************************************
If Not Foundrange Is Nothing Then
'Do Your STuff
Endif
Next RowDates

End Wit
 
K

Keith Willshaw

andycharger > said:
Hi,

someone suggested to me that I use .find on a range so I can find a row
and do some editing.

However, the statement I have returns me the value of one cell and I
now want to select that entire row.

Can someone help?
set Foundrange = nothing
Set Foundrange = .Find( strRef, LookIn:=xlValues)
'**********************************************
'* here is where I guess I need to get the entire row once its found
'********************************************
If Not Foundrange Is Nothing Then

Dim Rownum as Long, RowRange as Range
Rownum=Foundrange.row
Set RowRange=Searchsheet.Rows(Rownum)
 

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