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
- 30461 reads
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 47 weeks ago
6 years 50 weeks ago
6 years 51 weeks ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago