Selection of range

  • Thread starter Thread starter me
  • Start date Start date
M

me

Hello All,
The following is the arrangement of a row.
25,26,27,28,29,30,25,26,27,28,29,30
The arrangement changes to
25,26,28,30,25,27,30 ( not on proper sereis)
when I refresh the data.
I would like to select the'range' from 25 to 30
always(first sereis only).Is automatic selection
of a range possible based on the above or
similar condition.
 
This is rude and crude. And it is set for row 1

===========================================
Dim ad As String

Range("A1").Select
ad = Cells.Find(What:="30", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False) _
.Address
ad = "A1: " & ad
Range(ad).Select
=======================================

This one might work for a row defined by a variable

Dim ad As String, r as Long

r = ??? ' need to define r

Cells(r,1).Select
ad = Rows(r).Find(What:="30", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False) _
.Address
ad = "A1: " & ad
Range(ad).Select

=========================
 
Back
Top