I have string "ololo123". I need get position of first digit - 1. How to set mask of search ?
相关问题
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
- VBA Self-Function returns #VALUE! Error on cell, w
相关文章
- Unregister a XLL in Excel (VBA)
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- How to disable changes in a cell using vba?
- MsgBox Yes/No Excel VBA
- Rounding up to nearest higher integer in VBA
- Deleting columns from a table with merged cells
- Convert range to comma delimited string
You could try regex, and then you'd have two problems. My VBAfu is not up to snuff, but I'll give it a go:
Then you just call it with
FirstDigit("ololo123")
.I actually have that function:
Here is a lightweight and fast method that avoids regex/reference additions, thus helping with overhead and transportability should that be an advantage.
Something like this should do the trick for you:
You can then call it like this:
If speed is an issue, this will run a bit faster than Robs (noi Rob):
Not sure on your environment, but this worked in Excel 2010