+ Reply to Thread
Results 1 to 4 of 4

Number formatting in VBA

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Lexington, KY
    MS-Off Ver
    Excel 2010
    Posts
    21

    Number formatting in VBA

    I am brand new to VBA and am running through some beginner examples. I have written the following code, but I was wondering how I could format how the number is presented in the msg box. Currently the msg box shows a percent with 7 decimal places. I would like 1 decimal place.

    Since I am trying to learn, I would greatly appreciate an explanation with the code that will do it.

    Please Login or Register  to view this content.
    Thanks in advance for all your help!

  2. #2
    Registered User
    Join Date
    08-23-2010
    Location
    india,Chennai
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: Number formatting in VBA

    use format function
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Lexington, KY
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Number formatting in VBA

    Thanks! That works perfectly. Can I use the format function anywhere I want when writing code?

  4. #4
    Registered User
    Join Date
    08-23-2010
    Location
    india,Chennai
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: Number formatting in VBA

    Yes you can

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1