VBA Convert Number Stored As Text To Number. Here the input value is number stored as number but in string format, we are converting this value as number. In the following article let us see an example. And also see the step by step instructions to run VBA code in the visual basic editor(VBE) window.
Convert Number Stored As Text To Number
Let us see an example VBA macro code how to Convert a range of Numbers Stored As Text To Numbers.
'Convert Number stored as text to Number Sub VBAF1_Convert_Number_Stored_as_Text_to_Number() 'Variable declaration Dim rngRange As Range 'Define Range which you want to convert to range Set rngRange = ActiveSheet.Range("A1:A20") 'Convert Number rngRange.Value = rngRange.Value End Sub
Explanation: You can change defined range as per your requirement. When dealing with huge data we can use above specified process to convert numbers to numbers which are stored as text. We can also loop through each cell, but it takes longer time to execute. Please find below screen shot for your reference.
Instructions to Run VBA Macro Code or Procedure:
You can refer the following link for the step by step instructions.
Instructions to run VBA Macro Code
Other Useful Resources:
Click on the following links of the useful resources. These helps to learn and gain more knowledge.
VBA Tutorial VBA Functions List VBA Arrays VBA Text Files VBA Tables
VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers Blog
Other Useful conversations:
Convert text to Number with ZERO Digits and Number convert ZERO Digits
Convert text to Number with TWO Digits and Number convert TWO Digits
Convert text to Number with SIX Digits and Number convert SIX Digits
Thanks for sharing useful codes!
Convert “05-09” stored as a text to number