Selection of range

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.
 
S

steve

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

=========================
 

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