The Excel spreadsheet I use the formula
'=SUMPRODUCT((Accounts!S2:S65536= 1) * (Accounts!R2:R65536 = """ """))
Then I include it in VBA to run across a select number of sheets, I use the ws.new in the worksheet name to locate the file, this works as I have taken out some more simple code in the below loop
The error is a type mismatch but the formula looks ok to me, same as the one in excel, any other eyes on it would be great
Thanks
Dim wsnew As Worksheet
offsetcounter = 0
For Each wsnew In Worksheets
If InStr(1, wsnew.Name, "Accounts") > 0 Then
Application.WorksheetFunction.SumProduct((Worksheets(wsnew.Name).Range("S:S") = 1) * (Worksheets(wsnew.Name).Range("R:R") = """ """))
offsetcounter = offsetcounter + 1
End If
Next wsnew
'=SUMPRODUCT((Accounts!S2:S65536= 1) * (Accounts!R2:R65536 = """ """))
Then I include it in VBA to run across a select number of sheets, I use the ws.new in the worksheet name to locate the file, this works as I have taken out some more simple code in the below loop
The error is a type mismatch but the formula looks ok to me, same as the one in excel, any other eyes on it would be great
Thanks
Dim wsnew As Worksheet
offsetcounter = 0
For Each wsnew In Worksheets
If InStr(1, wsnew.Name, "Accounts") > 0 Then
Application.WorksheetFunction.SumProduct((Worksheets(wsnew.Name).Range("S:S") = 1) * (Worksheets(wsnew.Name).Range("R:R") = """ """))
offsetcounter = offsetcounter + 1
End If
Next wsnew