View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] todd.huttenstine@charter.net is offline
external usenet poster
 
Posts: 17
Default Evaluate an Array Formula before inserting it in a cell

Hey

I have this string that is programatically inserted into a cell as an
array formula:
=1*MID(A2,MATCH(FALSE,ISERROR(1*MID(A2,ROW(INDIREC T("1:"&LEN(A2))),
1)),
0),LEN(A2)-SUM(1*ISERROR(1*MID(A2,ROW(INDIRECT("1:"&LEN(A2))) ,1))))


It returns a valid result when inserted as an array into a cell. But
I would like to be able to evaluate this
formula and get the result in VBA before I insert it into a cell.


Bob Phillips posted the following yesterday but its resulting in
runtime error 13 Type Mismatch:
MsgBox Activesheet.Evaluate( _
"1*MID(A2,MATCH(FALSE,ISERROR(1*MID(A2,ROW(INDIREC T(" & _
"""1:""&LEN(A2))),1)),0),LEN(A2)-SUM(1*ISERROR(1*MID(A2,ROW(" & _
"INDIRECT(""1:""&LEN(A2))),1))))")



Thanks
Todd