ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Row Numbers Within the RangeName (https://www.excelbanter.com/excel-programming/375399-finding-row-numbers-within-rangename.html)

Goofy

Finding Row Numbers Within the RangeName
 
Im a bit confused about this. I have a RangeName Table. I want to Find the
row which say "Blue" is in ( Relative to the range ) so

myRangeName.Find("Green") ' returns a range absolute to the spreadsheet,
this is no good to
me because I want to refer to the table using the Cells property. such as
..Cells('FoundRowNum,9) to get the adjacent value to Green. Whats the
simplest way to do this ?

Activity LookupValue
Blue 7
Green 9
Red 12






Charles Chickering

Finding Row Numbers Within the RangeName
 
Try a diferent approach:
Dim r As Range
Set r = MyRange.Find('Whatever)
MsgBox r.Offset(,1)
--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

Im a bit confused about this. I have a RangeName Table. I want to Find the
row which say "Blue" is in ( Relative to the range ) so

myRangeName.Find("Green") ' returns a range absolute to the spreadsheet,
this is no good to
me because I want to refer to the table using the Cells property. such as
..Cells('FoundRowNum,9) to get the adjacent value to Green. Whats the
simplest way to do this ?

Activity LookupValue
Blue 7
Green 9
Red 12







Goofy

Finding Row Numbers Within the RangeName
 
OK, Lateral thinking is good, but what If I have the following scenario ?
When I find(2) I will return column ?



Col1 Col2
1 2
2 3
3 6
4 5



"Charles Chickering" wrote in
message ...
Try a diferent approach:
Dim r As Range
Set r = MyRange.Find('Whatever)
MsgBox r.Offset(,1)
--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

Im a bit confused about this. I have a RangeName Table. I want to Find
the
row which say "Blue" is in ( Relative to the range ) so

myRangeName.Find("Green") ' returns a range absolute to the
spreadsheet,
this is no good to
me because I want to refer to the table using the Cells property. such as
..Cells('FoundRowNum,9) to get the adjacent value to Green. Whats the
simplest way to do this ?

Activity LookupValue
Blue 7
Green 9
Red 12









Charles Chickering

Finding Row Numbers Within the RangeName
 
I'm not sure what you're asking here. If you're worried about what column you
find the data in then limit the search
Set r = MyRange.Columns(1).Find('Whatever)

--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

OK, Lateral thinking is good, but what If I have the following scenario ?
When I find(2) I will return column ?



Col1 Col2
1 2
2 3
3 6
4 5



"Charles Chickering" wrote in
message ...
Try a diferent approach:
Dim r As Range
Set r = MyRange.Find('Whatever)
MsgBox r.Offset(,1)
--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

Im a bit confused about this. I have a RangeName Table. I want to Find
the
row which say "Blue" is in ( Relative to the range ) so

myRangeName.Find("Green") ' returns a range absolute to the
spreadsheet,
this is no good to
me because I want to refer to the table using the Cells property. such as
..Cells('FoundRowNum,9) to get the adjacent value to Green. Whats the
simplest way to do this ?

Activity LookupValue
Blue 7
Green 9
Red 12










Goofy

Finding Row Numbers Within the RangeName
 
Thats fine, I found you could alter the search by columns or row, so thats
solved it

Cheers



"Charles Chickering" wrote in
message ...
I'm not sure what you're asking here. If you're worried about what column
you
find the data in then limit the search
Set r = MyRange.Columns(1).Find('Whatever)

--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

OK, Lateral thinking is good, but what If I have the following scenario ?
When I find(2) I will return column ?



Col1 Col2
1 2
2 3
3 6
4 5



"Charles Chickering" wrote
in
message ...
Try a diferent approach:
Dim r As Range
Set r = MyRange.Find('Whatever)
MsgBox r.Offset(,1)
--
Charles Chickering

"A good example is twice the value of good advice."


"Goofy" wrote:

Im a bit confused about this. I have a RangeName Table. I want to Find
the
row which say "Blue" is in ( Relative to the range ) so

myRangeName.Find("Green") ' returns a range absolute to the
spreadsheet,
this is no good to
me because I want to refer to the table using the Cells property. such
as
..Cells('FoundRowNum,9) to get the adjacent value to Green. Whats the
simplest way to do this ?

Activity LookupValue
Blue 7
Green 9
Red 12













All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com