hi why do i get the runtime error 13: type mismatch error while running the following code
Application.Goto Reference:="R1C1:R232C221"
Selection.FormulaArray = "=ROUND(a(),0)"
Selection.Replace What:="a()", Replacement:="IF(IF(Sheet4!A1:HM232+Sheet5!A1:HM232=2,0," & _
"Sheet4!A1:HM232+Sheet5!A1:HM232)+IF(Sheet4!A1:HM232+Sheet5!A1:HM232=2,0," & _
"Sheet4!A1:HM232+Sheet5!A1:HM232)=2,0,IF(Sheet4!A1:HM232+Sheet5!A1:HM232=2,0," & _
"Sheet4!A1:HM232+Sheet5!A1:HM232)+IF(Sheet4!A1:HM232+Sheet5!A1:HM232=2,0,Sheet4!A1:HM232+Sheet5!A1:HM232))", LookAt _
:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
Range("I9").Select
1) i know that formulaarray should be in R1C1 style... but A1 style is not required, it also works without any problems in A1 style
http://msdn.microsoft.com/en-us/library/bb208529.aspx
2) i found this way of writing from
http://www.dailydoseofexcel.com/archives/2005/01/10/entering-long-array-formulas-in-vba/