#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Can't format column

Hello,

I'm trying to custom format a column but nothing happens when I apply the
formatting. The column contains entries such as this:
N163975A
B142237K
B141917K
B144973K
B189601K
and I'm trying to format them so they look like this:
N16-3975-A
B14-2237-K
B14-1917-K
B14-4973-K
B18-9601-K

I've confirmed the tools/options/view and the formula box is unchecked. I
have also cleared all formatting before trying to apply my own and still
nothing.

TIA,
Marta
  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Can't format column

you can't custom format text like you can numbers.
try =left(A1,3)&"-"&Mid(A1,4,4)&"-"&right(A1,1)
copy and paste special

"Marta" wrote:

Hello,

I'm trying to custom format a column but nothing happens when I apply the
formatting. The column contains entries such as this:
N163975A
B142237K
B141917K
B144973K
B189601K
and I'm trying to format them so they look like this:
N16-3975-A
B14-2237-K
B14-1917-K
B14-4973-K
B18-9601-K

I've confirmed the tools/options/view and the formula box is unchecked. I
have also cleared all formatting before trying to apply my own and still
nothing.

TIA,
Marta

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Can't format column

You cannot format text that way, you would need a help column and a formula

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


--


Regards,


Peo Sjoblom


"Marta" wrote in message
...
Hello,

I'm trying to custom format a column but nothing happens when I apply the
formatting. The column contains entries such as this:
N163975A
B142237K
B141917K
B144973K
B189601K
and I'm trying to format them so they look like this:
N16-3975-A
B14-2237-K
B14-1917-K
B14-4973-K
B18-9601-K

I've confirmed the tools/options/view and the formula box is unchecked. I
have also cleared all formatting before trying to apply my own and still
nothing.

TIA,
Marta



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Can't format column

If a macro solution is okay for you to use, then you might want to consider
this...

1) You already entered the numbers and want to change them. If this is the
case, you can select those already filled in cells and run this macro...

Public Sub InsertDashes()
Dim C As Range
For Each C In Selection
If C.Value Like "[A-Za-z]######[A-Za-z]" Then
C.Value = Format(C.Value, "@@@-@@@@-@")
End If
Next
End Sub


2) You want to type in the 8-character entry and have it change to the
format you want when you enter it. Add this Worksheet Change event to the
code window for the sheet where you will be entering your "numbers"
(right-click on that sheet's tab and select View Code from the popup
menu)...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Col As Range
Set Col = Range("A:A")
On Error Resume Next
If Not Intersect(Col, Target) Is Nothing Then
If Target.Value Like "[A-Za-z]######[A-Za-z]" Then
Application.EnableEvents = False
Target.Value = Format(Target.Value, "@@@-@@@@-@")
Application.EnableEvents = True
End If
End If
End Sub

By the way, I have assumed your 8-character entry is always a letter
followed by 6 digits followed by a letter. If that is not the case, then let
us know what your parameters are and someone here will modify the code for
you.

Rick


"Marta" wrote in message
...
Hello,

I'm trying to custom format a column but nothing happens when I apply the
formatting. The column contains entries such as this:
N163975A
B142237K
B141917K
B144973K
B189601K
and I'm trying to format them so they look like this:
N16-3975-A
B14-2237-K
B14-1917-K
B14-4973-K
B18-9601-K

I've confirmed the tools/options/view and the formula box is unchecked. I
have also cleared all formatting before trying to apply my own and still
nothing.

TIA,
Marta


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
How do I format the A/ B Column to be fixed like numeric column RYarn Excel Worksheet Functions 1 August 17th 07 02:18 AM
How do I format the A/ B Column to be fixed like numeric column bj Excel Worksheet Functions 0 August 17th 07 02:04 AM
How do I format the A/ B Column to be fixed like numeric column April Excel Worksheet Functions 0 August 17th 07 01:57 AM
Label Format to Column Format drakehouse Excel Discussion (Misc queries) 3 November 14th 06 12:30 AM
Format a column wihtout using "Format-Cells-Number-category-etc" serve Excel Worksheet Functions 4 February 24th 06 12:54 AM


All times are GMT +1. The time now is 02:20 AM.

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"