+ Reply to Thread
Results 1 to 8 of 8

Custom formatting for Vehicle no. and Phone no.

  1. #1
    Registered User
    Join Date
    11-20-2021
    Location
    Mp, India
    MS-Off Ver
    2016
    Posts
    17

    Custom formatting for Vehicle no. and Phone no.

    Hello guys I want vehicle no. and phone no. in a particular format...
    but I don't want to disturb the source data...
    so I thought I should use custom formatting
    but I am unable to come up with a solution especially for vehicle no.
    as the no of characters varies from 9-10...
    please look at the sample worksheet for a better layout...
    I would really appreciate any help i can get...
    Attached Files Attached Files
    Last edited by Gary_Di; 12-15-2021 at 03:29 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,432

    Re: Custom formatting for Vehicle no. and Phone no.

    For the Telephone set your custom formatting as follows:

    +91 (###)###-####

    I don't have a current solution for the Cars
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,432

    Re: Custom formatting for Vehicle no. and Phone no.

    Since you are using 2016, you have power query functionality available. Here is the Mcode for your issue.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.

    File attached for your review.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    26,153

    Re: Custom formatting for Vehicle no. and Phone no.

    Excel does not apply custom formatting to text. You will have to use a formula for your vehicle numbers.

    =LEFT(A5,4)&"-"&MID(A5,5,LEN(A5)-8)&"-"&RIGHT(A5,4)

    For the phone numbers use

    +91 (000)000-0000
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    11-20-2021
    Location
    Mp, India
    MS-Off Ver
    2016
    Posts
    17

    Re: Custom formatting for Vehicle no. and Phone no.

    Thank You, everyone, for your answers
    I really thankful for all your answers

  6. #6
    Registered User
    Join Date
    11-20-2021
    Location
    Mp, India
    MS-Off Ver
    2016
    Posts
    17

    Re: Custom formatting for Vehicle no. and Phone no.

    Sir your solution is awesome but is there no way to do it in the same column instead of creating a new column

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    26,153

    Re: Custom formatting for Vehicle no. and Phone no.

    Alan's PQ solution may do that, I am not up on PQ. However, there is no possible solution using just custom formats.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,013

    Re: Custom formatting for Vehicle no. and Phone no.

    Macro to change in entry cell range A1:A100) - change as required


    Please Login or Register  to view this content.

    Right click on tab name, view code and copy / paste code
    Last edited by JohnTopley; 12-16-2021 at 06:08 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. AutoFilter phone number column while keeping phone number formatting
    By Daneyuleb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2021, 12:49 AM
  2. Index vehicle, driver and vehicle wise revenue report.
    By dackson in forum Excel Formulas & Functions
    Replies: 41
    Last Post: 06-02-2017, 01:40 AM
  3. [SOLVED] Phone number format - reference post (Formatting Textbox to type phone numbers only)
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2015, 05:35 PM
  4. Custom Phone number format
    By joshbgosh10592 in forum Excel General
    Replies: 6
    Last Post: 05-22-2015, 05:12 PM
  5. Custom Cell Format for Phone numbers
    By annieb in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-07-2013, 06:14 AM
  6. Replies: 2
    Last Post: 01-30-2013, 12:06 PM
  7. custom phone number format help needed
    By jcat3az in forum Excel General
    Replies: 1
    Last Post: 09-27-2011, 08:05 PM

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