Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JFlorindo
 
Posts: n/a
Default format text in excel

How do i format a text cell in Excel, for example: 1122AA to 11-22-AA
  #2   Report Post  
Bill Ridgeway
 
Posts: n/a
Default

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" wrote in message
...
How do i format a text cell in Excel, for example: 1122AA to 11-22-AA



  #3   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

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" wrote in message
...
How do i format a text cell in Excel, for example: 1122AA to 11-22-AA



  #4   Report Post  
Anne Troy
 
Posts: n/a
Default

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" wrote in message
...
How do i format a text cell in Excel, for example: 1122AA to 11-22-AA



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Convert numbers from text format to number format merlin68 Excel Discussion (Misc queries) 7 June 20th 07 07:03 PM
Imported Date & Time format with calcs. managed in excel from imrp Todd F. Excel Worksheet Functions 0 July 8th 05 09:03 PM
Copying excel format from cell to cell Loopy Darren Excel Discussion (Misc queries) 2 April 12th 05 04:29 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM


All times are GMT +1. The time now is 09:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"