This a neat way to add functions to your files. On the sheet use formula:
=MySum(I4:I200). Place the below code into a module. Note: it will produce
an error if you have a cell in column I (before the next blank cell)that is
non-numeric. This can be easily reconciled with a little extra code.
Function MySum(myRange)
Dim c, MyValue
For Each c In myRange
If Trim(c) <> "" Then
MyValue = MyValue + c
Else
Exit For
End If
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.