Closed Thread
Results 1 to 4 of 4

format text in excel

  1. #1
    JFlorindo
    Guest

    format text in excel

    How do i format a text cell in Excel, for example: 1122AA to 11-22-AA

  2. #2
    Bill Ridgeway
    Guest

    Re: format text in excel

    Assuming that the text 1122AA is in cell A1 -

    =LEFT(A1,2)&"-"&MID(A1,3,2)&"-"&RIGHT(A1,2)

    Regards.

    Bill Ridgeway
    Computer Solutions

    "JFlorindo" <JFlorindo@discussions.microsoft.com> wrote in message
    news:B0E13D27-EB18-4FC5-B705-3E1D12072C87@microsoft.com...
    > How do i format a text cell in Excel, for example: 1122AA to 11-22-AA




  3. #3
    Mangesh Yadav
    Guest

    Re: format text in excel

    if the length is fixed, and your text is in cell A1, then use:
    =LEFT(A1,2)&"-"&MID(A1,3,2)&"-"&RIGHT(A1,2)

    Mangesh



    "JFlorindo" <JFlorindo@discussions.microsoft.com> wrote in message
    news:B0E13D27-EB18-4FC5-B705-3E1D12072C87@microsoft.com...
    > How do i format a text cell in Excel, for example: 1122AA to 11-22-AA




  4. #4
    Anne Troy
    Guest

    Re: format text in excel

    Hi, J. If you want this to occur automatically, and supposing you type these
    values into column A, then you can right-click the worksheet tab and hit
    View Code. Then paste this code into the code window that appears at right:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Not Application.Intersect(Target, Range("A:A")) Is Nothing Then
    Target(1).Value = Left(Target(1), 2) & "-" & Mid(Target(1), 3, 2) & "-"
    & Right(Target(1), 2)

    End If
    Application.EnableEvents = True
    End Sub

    Code stolen from Chip Pearson's site and adapted for your purpose.
    http://www.cpearson.com/excel/case.htm

    *******************
    ~Anne Troy

    www.OfficeArticles.com


    "JFlorindo" <JFlorindo@discussions.microsoft.com> wrote in message
    news:B0E13D27-EB18-4FC5-B705-3E1D12072C87@microsoft.com...
    > How do i format a text cell in Excel, for example: 1122AA to 11-22-AA




Closed 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