Thread
:
Keep getting runtime error 1004
View Single Post
#
2
Posted to microsoft.public.excel.programming
JE McGimpsey
external usenet poster
Posts: 4,624
Keep getting runtime error 1004
Without knowing what you're trying to accomplish, it seems to me that
removing the two single quotes in the formula string will allow it to be
parsed.
In article . com,
wrote:
Hi,
I'm trying to implement the following, but just couldn't figure out why
I keep getting a runtime error 1004 on Unable to set FormulaArray
Property of the Range Class. Can anyone enlighten me please? Thanks!
Dim NumRows As Integer
Dim NumBins As Integer
Dim ICol As Integer
Dim IRow As Integer
Dim sRngCol As String
Dim sRngR As String
Dim sRngC As String
Dim sRngLot As String
For IRow = 2 To NumRows
For ICol = 1 To NumBins
sRngCol = "rngCol" & ICol + 4
sRngR = "R" & IRow
sRngC = "C" & ICol
sRngLot = sRngR & sRngC
ActiveSheet.Cells(IRow, ICol).FormulaArray = _
"=AVERAGE(IF(rngCol1='" & sRngLot & ",'" & sRngCol & "))"
Next ICol
Next IRow
Reply With Quote
JE McGimpsey
View Public Profile
Find all posts by JE McGimpsey