Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Cell References in functions

Andrew,

If we pass the operator as another parameter, it is quite easy, such as

=d(A12,"^5")

The UDF is then

Function d(rng, op As String)
If rng.Cells.Count 1 Then
d = CVErr(xlErrRef)
Else
MsgBox rng.Address
d = Evaluate("(" & rng.Value & op & ")-(" & rng.Offset(-1, 0).Value
& op & ")")
End If
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andrew Smith" wrote in message
...


Thanks, this is great! Suppose I wanted to add the possibility of
nested functions within the timeseries. For instance, d(a12^5). Do you
know of a command like isrange that would allow me to figure out that
the input wasn't a range and go through a separate processing loop. I
notice that if I dim rng as Variant it will still work ok for the range
way.

Thanks,
Andrew

*** Sent via Developersdex http://www.developersdex.com ***



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Subtotal functions using cell references JeffB Excel Discussion (Misc queries) 2 August 14th 09 02:45 PM
Moving worksheet references in functions scuba Excel Discussion (Misc queries) 3 June 13th 08 10:46 PM
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
External References in Functions Ferencko Excel Worksheet Functions 2 March 21st 07 07:30 PM
How to use complex no. functions that have cell references? agathon Excel Worksheet Functions 2 June 17th 05 01:55 AM


All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"