As the title suggests I am looking for a way to retrieve all the numbers from a cell comment and add them up. The only way I can think to do this would be to retrieve the comment as a string, assign each set of numbers to a variable, then add up the variables?
I am having a hard time with the logic, I don't know a way to retrieve the numbers out of a comment.
So far I have:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim varComment As String
For i = 19 To 30
If Not Intersect(Target, Range("N19:N30")) Is Nothing Then
On Error Resume Next
varComment = Cells(Ni).Comment.Text
Next i
End If
End Sub
The use is that I have a comment in cells N19:N30 that contains dollar values, "Food - $20, Gas - $40, etc..." I want the cell value to be updated anytime a new listing is made to reflect the total cost. Make sense?