PC Review


Reply
Thread Tools Rate Thread

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

 
 
Michelle
Guest
Posts: n/a
 
      14th Aug 2009
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

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      14th Aug 2009
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.



Michelle wrote:
>
> 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


--

Dave Peterson
 
Reply With Quote
 
Michelle
Guest
Posts: n/a
 
      14th Aug 2009
Thanks, I asked a bit of a thick question there, I really should have worked
that out. But thanks for the answer anyway.

M

"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
> Michelle wrote:
>>
>> 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

>
> --
>
> Dave Peterson


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using INDIRECT Function and INDEX Function ChristopherG Microsoft Excel Misc 1 10th Jun 2009 04:07 PM
Indirect function in Forecast function Graham Tritton Microsoft Excel Discussion 1 17th Feb 2008 06:13 PM
Indirect function help please =?Utf-8?B?R3V5?= Microsoft Excel Worksheet Functions 10 6th Aug 2007 11:06 AM
INDIRECT function inside AND function =?Utf-8?B?YW5keTYy?= Microsoft Excel Worksheet Functions 4 23rd Sep 2006 07:20 PM
INDIRECT.EXT function, PULL function paul Microsoft Excel Worksheet Functions 10 26th Jan 2005 03:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 PM.