View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jeremiah Jeremiah is offline
external usenet poster
 
Posts: 49
Default Type Mismatch when trying to sum columns

With this sub I get "Unable to get sum property of the worksheetfunction class.

"Jim Cone" wrote:


If .Cells(lRow, "B").Value < "Year To Date" Then
Cells(lRow, "R").Value = WorksheetFunction.Sum(Cells(lRow, "D").Value, _
Cells(lRow, "F").Value, Cells(lRow, "I").Value, Cells(lRow, "L").Value)
End If
--
Jim Cone
Portland, Oregon USA


"jeremiah"
wrote in message
I am trying to sum the value in 4 numbers across the same row if the value of
another cell in that row is a specific string. I need to be able to loop
through the sheet because there are multiple rows that I will need to search
for my criteria. Using the below sub I get a typemismatch error - I assume
it is because some of my cell values may be blank - is there a way to
correct this
-snip-