View Single Post
  #3   Report Post  
BG
 
Posts: n/a
Default

Hi Trevor,

Thank you for your interest!

You are correct - i.e., both calls return results and =say_what(
Sheet1_Table ) returns 4 x 4. However, my question is: How do I make
=say_what( c1 ) produce the same result as =say_what( INDIRECT(c1) )? That
is, what do I need to do in the say_what finction to emulate the INDIRECT
function?

Thanks again, BG

"Trevor Shuttleworth" wrote:

I'd say what the two calls return are correct.

You could also try: =say_what( Sheet1_Table ) = 4 by 4

Regards

Trevor


"BG" wrote in message
...
Given a NAMED range called "Sheet1_Table" that refers to "Sheet1!e1:h4"
and
the value "Sheet1_Table" in cell C1, how can I get the following VBA
function:

Function say_what(ByRef input_arg As Variant) As Variant
If TypeName(input_arg) = "Range" Then
say_what = input_arg.Rows.Count & " by " & input_arg.Columns.Count
Else
say_what = TypeName(input_arg)
End If
End Function

to return the same result for =say_what( indirect(c1) ) and =say_what(
c1 )?

say_what( indirect(c1) ) returns a correct "4 by 4" but say_what( c1 )
returns an incorrect "1 by 1".

Thank you,



How can I get