JonRowland
Active Member
- Joined
- May 9, 2003
- Messages
- 417
- Office Version
- 365
- Platform
- Windows
Hi,
The following code will strip numbers from a string however I would like the opposite and like to strip all but numbers from a string which is then placed into a variable (in this case celltext.
Not IsNumeric doesn't work and IsText doesn't seem to work. My question is is there an opposite of IsNumeric?
Thanks Jon
The following code will strip numbers from a string however I would like the opposite and like to strip all but numbers from a string which is then placed into a variable (in this case celltext.
Not IsNumeric doesn't work and IsText doesn't seem to work. My question is is there an opposite of IsNumeric?
VBA Code:
While IsNumeric(Right(celltext, 1))
celltext = Left(celltext, Len(celltext) - 1)
Wend
'Write the new text string back into the cell
Selection.Value = celltext
Thanks Jon