Hello everyone,
i have a string that looks like this: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
I am trying to get every number between the "@" and "," (19, 27, 27, 27, 6, 73...) and multiply them with 0.9.
This is my approach so far but it only gets me to 19. Not sure how to get through the whole string.
Code
Sub ExtractNumbersFromString()
Dim str As String
Dim FirstPos As Integer
Dim LastPos As Integer
Dim NumberToExtract As String
str = Range("C1").Value
FirstPos = InStr(str, "@")
LastPos = InStr(str, ",")
NumberToExtract = Mid(str, openPos + 1, closePos - openPos - 1)
End Sub
Display More
What would you guys suggest is the best way to do this?
Thank you!