Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Dukker Jansen   on Jan 16 In MS Office Category.

  
Question Answered By: Lee Butler   on Jan 16


Use



vNumber = Val(strNumber)



Or



vNumber = CInt(strNumber)



Val() and CInt() have slightly different functionality for unusual
conditions.



For example, CInt(“234a”) returns an error, while Val(“234a”) returns 234.
It’s up to you which one is more appropriate in your application.



There’s also CLng() to convert  to a Long (and CBool() to convert to Boolean,
CSng() to convert to Single, CDbl() to convert to Double, CStr() to convert
to String, CDate() to convert to Date, etc.).

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Converting a "Stringed" Number to a Number Or get search suggestion and latest updates.


Tagged: