using .find to get me a row

  • Thread starter Thread starter andycharger
  • Start date Start date
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
 
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)
 
Back
Top