31. VBA Tips - Convert Text To Number VBA
Convert Text To a Number using VBA
- use: EVALUATE()
Here's a step through demo sub routine:
Sub ConvertTextToNumber() ' set 'a' to a piece of text a = "123" ' display it MsgBox a ' Is it a number ? No MsgBox Application.IsNumber(a) ' convert text to number a = Evaluate(a) ' display it.. NOTE - it looks the same MsgBox a ' Is it a number ? Yes MsgBox Application.IsNumber(a) End Sub
Download sheet to practise how to Convert Text To a Number using VBA
Training video on how to Convert Text To a Number
»
- Nick's blog
- Login or register to post comments
- 30069 reads
Recent comments
5 years 6 weeks ago
5 years 44 weeks ago
6 years 4 weeks ago
6 years 7 weeks ago
6 years 8 weeks ago
6 years 13 weeks ago
6 years 21 weeks ago
6 years 22 weeks ago
6 years 22 weeks ago
6 years 22 weeks ago