Consulting

Results 1 to 3 of 3

Thread: Solved: SUMIFS

  1. #1
    VBAX Regular
    Joined
    Apr 2009
    Posts
    9
    Location

    Solved: SUMIFS

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Apr 2009
    Posts
    9
    Location
    Nice, thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •