This macro does the first part of the job, but it's not clear for me what do
you want to replicate? This Sumproduct formula with the same column
references (H,G,F) or with other column references (if so, which columns)?
Sub sumprodtest()
Columns("H:H").Find(What:="*", _
After:=Range("H1"), _
LookAt:=xlPart, _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Activate
lastfilled = ActiveCell.Row
Range("H" & lastfilled + 1).FormulaR1C1 = _
"=SUMPRODUCT(R[-" & lastfilled & "]C:R[-1]C,--(R[-" & lastfilled &
"]C[-1]:R[-1]C[-1]=""o""),--(NOT(ISERROR(SEARCH(""F"",R[-" & lastfilled &
"]C[-2]:R[-1]C[-2])))))"
End Sub
Regards,
Stefi
€žSally€ť ezt Ă*rta:
Hello
I am relatively new to VB and need help. I am not quite sure how to
accomplish this.... I need routine that will find the first blank cell in
Col H and insert a sumproduct type formula. That will sum all of the cells
in Col H where the value in the same row in col G is equal to "o" and the
value in col F contains "F". I also need to replicate this over 20 columns in
the same row. I am still trying to learn how to use sumproduct so if the
formula use would be different, what would this be?
Thanks