PDA

View Full Version : Solved: SUMIFS



Mcaa51
03-30-2010, 02:47 PM
This is probably a dumb question...but how does one add a worksheet function via VBA when it contains " ".....such as the below

For Counter = 2 To (CountCallsAgainst + 1)

With wsAdd
.Cells(Counter, 1).Value = myCallsAgainst((Counter - 1), 1)
.Cells(Counter, 2).Value = myCallsAgainst((Counter - 1), 2)
.Cells(Counter, 3).Value = myCallsAgainst((Counter - 1), 3)
.Cells(Counter, 5).Value = "=SUMIFSEXP,NUM,A2,CUSIP,"371488AG2")"

End With

Next Counter

The below line keeps giving me errors

.Cells(Counter, 5).Value = "=SUMIFSEXP,NUM,A2,CUSIP,"371488AG2")"

Thank you

Bob Phillips
03-30-2010, 03:00 PM
For Counter = 2 To (CountCallsAgainst + 1)

With wsAdd
.Cells(Counter, 1).Value = myCallsAgainst((Counter - 1), 1)
.Cells(Counter, 2).Value = myCallsAgainst((Counter - 1), 2)
.Cells(Counter, 3).Value = myCallsAgainst((Counter - 1), 3)
.Cells(Counter, 5).Value = "=SUMIFS(EXP,NUM,A2,CUSIP,""371488AG2"")"

End With

Next Counter

Mcaa51
03-31-2010, 12:41 PM
Nice, thank you.