M
mark kubicki
o.k., i give up; hthe findNext line is causing an error,
anny suggestions (XL2002, XP)
Public Function subHousemateUtility(name As Range)
Application.Volatile
Dim c
Dim firstAddress
Dim subtotal
With Worksheets("Tally Sheet").Range("B3:B10")
Set c = .Find(name.Value, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
subtotal = subtotal + c.Value
Set c = .FindNext(after:=c.Address)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
subHousemateUtility = c.Address
End Function
thanks in advance
mark
anny suggestions (XL2002, XP)
Public Function subHousemateUtility(name As Range)
Application.Volatile
Dim c
Dim firstAddress
Dim subtotal
With Worksheets("Tally Sheet").Range("B3:B10")
Set c = .Find(name.Value, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
subtotal = subtotal + c.Value
Set c = .FindNext(after:=c.Address)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
subHousemateUtility = c.Address
End Function
thanks in advance
mark