Is it possible to check if a number exists in a string using VBA? Say I have a number - 137785973201908000000000
- and it is in a cell formatted as Number, how do I convert it to a string to use the InStr
function?
At the moment, if I use CStr(number)
it will convert it to - 1.37785973201908E+23
- which is not ideal. The string I am trying to find the number in looks like this - [137785973201908000000000] Product Shipped.
When using If InStr(stringVar, CStr(numberVar)) > 0 Then
it will not find the number because it is converting it to the scientific notation when converting to text.
Is there VBA coding that can stop this?