+ Reply to Thread
Results 1 to 6 of 6

Convert formatting to actual text

  1. #1
    Forum Contributor
    Join Date
    08-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    119

    Convert formatting to actual text

    Is there a way with VBA to convert custom formatting into actual text. I have some numbers that are formatted as fractions, but the value itself is still a decimal. Is there a way to convert it to a text string so that contents of the cell is actually a fraction.

    Ex: With my formatting 21.25 displays as 21-1/4 but the value of the cell is still 21.25. I need the actual contents of the cell to be 21-1/4.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Convert formatting to actual text

    Hello chaddug,

    Each cell on the worksheet has two properties: Value and Text. Value will display the number, date, etc, as a numeric value. Text will return what you see in the cell as a text string.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Convert formatting to actual text

    Have you looked at the TEXT function.
    (The Value and Text that Leith is speaking of are VBA properties. I'm talking about the worksheet function TEXT)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Contributor
    Join Date
    08-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    119

    Re: Convert formatting to actual text

    Okay, using that information I tried this as a test and I got an Object Required error. The cells in column E have the numbers formatted as fractions, I want the actual text string in column F.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Convert formatting to actual text

    It can be easily done with formula

    =TEXT(A1,"00-0/0")

    Row\Col
    A
    B
    1
    21.25
    21-1/4
    2
    123.75
    123-3/4
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Convert formatting to actual text

    Keep in mind, that if you convet the value to text, you will not be able to use it in future calcs, without a potentially involved conversion back to numeric.

    What is the need for the conversion?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Convert date to actual day of the week
    By georgewash in forum Excel General
    Replies: 2
    Last Post: 12-01-2014, 04:37 PM
  2. Replies: 9
    Last Post: 06-14-2013, 04:38 AM
  3. convert picture links to actual, embedded pictures?
    By Adinmem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2013, 04:41 PM
  4. [SOLVED] convert 'calculation result' to actual 'number'
    By Chubster in forum Excel General
    Replies: 2
    Last Post: 10-21-2012, 01:17 PM
  5. Convert date as text to actual date
    By andysurtees in forum Excel General
    Replies: 4
    Last Post: 01-23-2009, 03:22 AM

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