flying_rock27
New Member
- Joined
- Dec 10, 2010
- Messages
- 3
So I need to extract numbers from multiple cells withing a range, having added them up. The current extract number function I found only works for one cell at a time.
Function ExtractNumber(Target As Range) As Variant
Dim i As Integer
Dim str1 As String
For i = 1 To Len(Target)
If IsNumeric(Mid(Target, i, 1)) Then
str1 = str1 + Mid(Target, i, 1)
End If
Next i
ExtractNumber = str1
End Function
Not only that, but I need to extract and add only the ones that are in <>. For example,
Homework#3 <Numeric MaxPoints:10>, I only need the 10. However, I'd be more than gratefully if someone only helped me with my first task. Thanks to anyone in advance (Also, I'm a noob here ^^', so please pardon any rudeness I gave)
Function ExtractNumber(Target As Range) As Variant
Dim i As Integer
Dim str1 As String
For i = 1 To Len(Target)
If IsNumeric(Mid(Target, i, 1)) Then
str1 = str1 + Mid(Target, i, 1)
End If
Next i
ExtractNumber = str1
End Function
Not only that, but I need to extract and add only the ones that are in <>. For example,
Homework#3 <Numeric MaxPoints:10>, I only need the 10. However, I'd be more than gratefully if someone only helped me with my first task. Thanks to anyone in advance (Also, I'm a noob here ^^', so please pardon any rudeness I gave)