Can I use INDIRECT in the code (of a function)

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I'm writing a UD function and I want to utilise the INDIRECT function in the
calculation, but it isn't in the pick-list for 'WorksheetFunction.' does
this mean I can't use it?

Is there an alternative?

M
 
If I had:
B1:B10
in A1 of a worksheet, I could use:

=sum(indirect(a1))
to sum B1:B10

In code, I'd just use:

with activesheet
msgbox application.sum(.range(.range("A1").value))
end with

..range("A1").value will be B1:B10
and that means that
..range("B1:b10")
will be summed.
 
Thanks, I asked a bit of a thick question there, I really should have worked
that out. But thanks for the answer anyway.

M
 
Back
Top