View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Cooper Mike Cooper is offline
external usenet poster
 
Posts: 2
Default Getting Application.Sum to act like =SUM

Hi there,

I am attempting to create a VBA subroutine which will perform the work
of
=SUM(Range)

The following:

MySum = Application.Sum(Cells(Master_New_Entry_Row, 2), _
Cells(Master_New_Entry_Row, 6))

....works just fine except for one flaw. With the =SUM excel function,
non-numeric columns get ignored and the function still sums the
numeric columns within the given range. Using "Application.Sum" they
don't. If there is a non-numeric column in the above range, the
function errors out!

Is there anyone who can tell me a way to make Application.Sum act like
=SUM without having to verify each and every column as numeric first?

Thank you,
Mike Cooper