View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Caligirl Caligirl is offline
external usenet poster
 
Posts: 5
Default Not sure how to write the formula

this sounds like what I need. When I run it I get this error message:
Unable to get the Sum Property of the Worksheet Function Class

Any ideas?

"JP" wrote:

There is no such thing as "cells c through o". All cell names are a
combination row/column reference.

You would need VBA code for this. For example

Sub DeleteRows()

If WorksheetFunction.Sum(Range("C1:O1")) = 0 Then
Range("C1").EntireRow.Delete
End If

End Sub

Just some air code so please step through first. It will delete rows
with text so be sure to adjust the range as appropriate.

HTH,
JP

On Mar 14, 2:56 pm, Caligirl
wrote:
Okay, I got it. I just had to add this to your formula (f2-j2)/i2. That
made it work. Thank you so very much. Now I can move on to the next
dilemna.

Here's one for you: If cells c thru o are equal to zero then delete the
row? How in the world would I write that?



"Caligirl" wrote:
I am fairly new to writing formulas. The formula I always use is F2-J2/I2.
Pretty simple, except when I2 has no data or is zero then I get the #DIV..
How do I either keep the #DIV from showing or write the formula in such a way
that it basically says: If I2 is less than, equal to or has no data then
leave blank, if not process the above formula.- Hide quoted text -


- Show quoted text -