Got any Excel/VBA Questions? Free Excel Help.
The example below shows how CVar can be used in Excel VBA to convert to a Variant data type. Same range as Double for numerics. Same range as String for non-numerics.
Sub ConvertToVariant() Dim vStr vStr = 1000 MsgBox CVar(vStr & "000" + 9) End Sub
Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft
See also:
Free Training Course: Lesson 1 - Excel Fundamentals
See also: Index to Excel VBA Code; Index to Excel Freebies; Lesson 1 - Excel Fundamentals; Index to how to… providing a range of solutions
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.