Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Syntax to insert an array formula in a cell


What would be the proper syntax to have VBA to insert an array formul
in a cell? For example:

SheetData.Range("F4") = "=SUM(F7:F70)" inserts the formula.

However, the following does not work,
SheetData.Range("E4") = "{=SUM(--SUBSTITUTE(0 & E7:E70, " - ",""))}"

Any ideas. Thanks for all your help. mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=50667

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Syntax to insert an array formula in a cell

Hi Mike

You need to use the FormulaArray function

This code should work :

Range("E4").FormulaArray = "=SUM(--SUBSTITUTE(0 & R[3]C:R[66]C, "" -
"",""""))"

Thanks
Karthik Bhat

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Syntax to insert an array formula in a cell

From Help:

Worksheets("Sheet1").Range("E1:E3").FormulaArray = _
"=Sum(R1C1:R3C3)"

Tim

"mikeburg" wrote in
message ...

What would be the proper syntax to have VBA to insert an array formula
in a cell? For example:

SheetData.Range("F4") = "=SUM(F7:F70)" inserts the formula.

However, the following does not work,
SheetData.Range("E4") = "{=SUM(--SUBSTITUTE(0 & E7:E70, " - ",""))}"

Any ideas. Thanks for all your help. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:
http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=506670



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Syntax to insert an array formula in a cell


Thanks so very much. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=506670

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Syntax to insert an array formula in a cell

range("a1").formulaarray=

--
Don Guillett
SalesAid Software

"mikeburg" wrote in
message ...

Thanks so very much. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:
http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=506670





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
Array Formula Syntax question... Steve P[_2_] Excel Discussion (Misc queries) 3 November 6th 09 04:44 PM
Why hlookup error when I insert table array formula? Narnimar Excel Discussion (Misc queries) 2 July 22nd 09 04:46 AM
unable to solve array formula syntax Green Fox Excel Worksheet Functions 2 September 6th 07 02:24 PM
How do I always insert last cell from a increasing array ? Radu Excel Worksheet Functions 1 November 2nd 05 11:07 PM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Excel Programming 0 July 27th 05 03:59 PM


All times are GMT +1. The time now is 11:17 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"