Re: Find in a column

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Francis,

Try something like:

'============>>
Dim RngFound As Range
Const sSearchString As String = 44 '<<==== CHANGE

Set RngFound = rng.Find(What:=sSearchString, _
After:=rng.Cells(1), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not RngFound Is Nothing Then
'do something, e.g:
MsgBox RngFound.Row
End If
'<<============
---
Regards,
Norman



"Francis Hookham" <fh.2.net@xxxxxxxxxxxx> wrote in message
news:%235XiwR7eHHA.1244@xxxxxxxxxxxxxxxxxxxxxxx
In a subroutine I need to find which row where a specific numeral occurs
in a column A. numbers will start in A4 and there may be blank cells in
the column.



The Module already has the following

LastUsedRow = Cells(Rows.Count, 1).End(xlUp).Row

to find the range:

Range(cells(4,1),cells(LastUsedRow,1))



How do I carry on from there to find NumberRow?



Thanks



Francis Hookham




.



Relevant Pages

  • Re: Select cell by value
    ... Jim Thomlinson wrote: ... dim rngFound as range ... a worksheet will be the same (except for blank cells). ...
    (microsoft.public.excel.programming)
  • Re: Find in a column
    ... Adding to Norm's response: ... Dim RngFound As Range ... LastUsedRow = Cells.End.Row ... How do I carry on from there to find NumberRow? ...
    (microsoft.public.excel.programming)
  • Re: Find in a column
    ... Sub FindRowNum() ... LastUsedRow = Cells.End.Row ... 'loop to stop at LastUsedRow ... Dim RngFound As Range ...
    (microsoft.public.excel.programming)
  • Find in a column
    ... In a subroutine I need to find which row where a specific numeral occurs in ... a column A. numbers will start in A4 and there may be blank cells in the ... LastUsedRow = Cells.End.Row ... How do I carry on from there to find NumberRow? ...
    (microsoft.public.excel.programming)