+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Help with Custom Function that will auto add "MPH" after number I type

  1. #1
    Registered User
    Join Date
    05-09-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2007
    Posts
    3

    Help with Custom Function that will auto add "MPH" after number I type

    After some frustration in the office and some browsing of the web including this forum I am at a loss on how to achieve a format that will allow me to enter a value and have it auto formatted for MPH (amongst other descriptors).

    I have a simple spreadsheet for my construction project that details the days activities and weather conditions. I have created custom function to add the degree symbol after the temperature but am failing at having the MPG and IN added after wind speed and precipitation.

    Any ideas?

    TIA
    Last edited by Big O; 05-09-2011 at 02:27 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Help with Custom Function that will auto add "MPH" after number I type

    Can you post some of the formulas you've tried...even if they don't work...so we'll have a better understanding of what you're working with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    05-09-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help with Custom Function that will auto add "MPH" after number I type

    Absolutely.

    I started with 00 MPH and a pop up error message stating "Microsoft Office Excel cannot use the number format you typed. Try using one of the built-in number formats. For more information ......"



    ## MPH
    #, ##; MPH
    #, ## MPH
    ## "MPH"

    none of those error'd nor worked.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Help with Custom Function that will auto add "MPH" after number I type

    Try this custom number format:
    0 \M\P\H

    The backslashes cause the following character to be displayed literally and not interpreted...(otherwise, M would be treated as a month, H as an hour, etc)

    Does that help?

  5. #5
    Registered User
    Join Date
    05-09-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help with Custom Function that will auto add "MPH" after number I type

    Very nice ... thanks Ron. I just read about that for the first time this morning but didn't know it applied to text also. The instance I read about was applied to decimal symbol and use the slash to do a literal instead of interpret.

    Thanks again!

+ 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