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
- 30384 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago