+ Reply to Thread
Results 1 to 3 of 3

Convert and format numbers to text with VBA

  1. #1
    Registered User
    Join Date
    03-15-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    1

    Convert and format numbers to text with VBA

    Hi all.

    I open a .csv file where I have a number stored in one column. I need to format that number as text in a particular format (with leading zeroes) and move it to another place with some added code. If I were doing this manually I would use the worksheet text() function, to whit:

    ="BILL-TO - " & TEXT(J15,"0000000")

    Then I would copy the result and paste-special the value into the cell.

    But I need to do it in a function. Str() converts the number to text, but won't format it.

    Any help would be greatly appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Convert and format numbers to text with VBA

    Use this

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Convert and format numbers to text with VBA

    or you can use this better:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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