Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default array formulas and getformula UDF

Harlan, thanks. YOu figured it out.

"Harlan Grove" wrote:

Bob Phillips wrote...
I don't think you can, the braces are internal to Excel, to tell it to array
process the formula. As you know, you don't type them, Excel adds them as a
visual cue. It must also store something at the same time to tell itself how
to process it on a recalc.

....

But the udf in question just returns text, and its Range arguments
would have a HasArray property.

"Dave F" wrote in message
I use the following code to create a UDF, getformula:

Function GetFormula(Cell As Range) As String
GetFormula = Cell.Formula
End Function

....
Example: I have a formula, =SUM(A1:B5*D1:E5), which is entered as an array
formula. How come the UDF returns it without the brackets {}? Anyway to get
the UDF to properly recognize an array formula?

....

If you want array formulas treated specially, add code to the udf.

Function GetFormula(Cell As Range) As String
GetFormula = Cell.Formula
If Cell.HasArray Then GetFormula = "{" & GetFormula & "}"
End Function


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
GetFormula function- Need help showing formulas only- [email protected] Excel Worksheet Functions 2 January 9th 06 02:52 PM


All times are GMT +1. The time now is 03:12 PM.

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"