Find method

S

Sajit

The help for the find method tells me,

"Finds specific information in a range, and returns a Range object that
represents the first cell where that information is found. Returns Nothing if
no match is found. Doesn’t affect the selection or the active cell."

But I see that the result of the find in the expression,

range1.find("text1")

finds the text1 string itself and not the cell reference. For this I have to
have,

range1.find("text1").row

however this returns the absolute row reference and not relative to the range.

1) Why does not the find method return a result as in the help?
2) How do I get a row reference relative to the range?
 
S

Stefi

1. Find method returns a range object as it's stated in Help, not its address
or row No. You can access a property of the range object with
range1.find("text1").row

2. range1.find("text1").row - range1.row

Regards,
Stefi

„Sajit†ezt írta:
 
S

Sajit

'text1' is a literal within the range1 that the expression finds. Is the
literal called as the range object? I thought the range object will be a
reference to the cell in which the literal was found.

Thanks Stefi,
 
S

Stefi

'text1' is a literal which is found in some cells within range1.
range1.find("text1") returns returns a range object consisting of one cell,
which is the first one among those in which 'text1' was found.
Reference (address) to this cell is a property of this one cell range, e.g.
range1.find("text1").address(false,false) is its relative address.

Regards,
Stefi

„Sajit†ezt írta:
 

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