+ Reply to Thread
Results 1 to 2 of 2

Convert Excel NumberFormat to string

Hybrid View

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    new jersey usa
    MS-Off Ver
    Excel 2010
    Posts
    1

    Convert Excel NumberFormat to string

    Greetings,

    I would like to concatenate a string value to a numberformat as fraction, the issue is when I contatinate a string value it reverts back to a decimal.
    /
    Cells(r, i + 1).NumberFormat = "# ?/?"
    Cells(r, i + 1) = Str(Cells(r, i + 1))
    /*
    Produces----> 5/8

    while this
    /
    Cells(r, i + 1).NumberFormat = "# ?/?"
    Cells(r, i + 1) = Str(Cells(r, i + 1))
    Cells(r, i + 1) = Cells(r, i + 1).Value & " Day"
    /*
    Produces----> 0.625 Day

    Any assistance would be greatly appreciated, thanks in advance for any help and support.
    Best Regards

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Convert Excel NumberFormat to string

    Use Text instead of Value.
    If posting code please use code tags, see here.

+ 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