Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default formatting macro

Hi all

I have a series of numbers 123456789 and it is followed with a letter a

I need to show on a worksheet in this format 123-456-789a I cant work out
how to set the cell i have tried 000-000-000 but not sure how to get it to
recognise the letter after

Thanks in advance

greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default formatting macro

Dear Greg

I am not an excel "expert" but seeing that you have had no replies, I have
had a similar problem so this may help. In my case I had a number which was
in effect several numbers all joined together to give one number about 35
digits long. Excel truncated the whole thing into one number and gave it in
scientific notation so I lost the precision. The solution was to format the
number as a text field, and then use the MID function to take out sections
of the number. each section into a different column, and then put it all
back together again as a string.

In your case, if you have an "a" at the end of your number Excel should
regard the "number" as a string and automatically format it as a text field,
but you may want to check that out. You can simply write three MID strings
and put it all together as one string with your dash between each set of
numbers (which is one string) and add the character a at the end. it is easy
enough if all of the original numbers are the same length. if the length is
variable you need to use the LEN function as well. for example, assuming all
of your numbers are in the style of 999888777a ... it would be formated as a
text field in cell A1 and then use the following in cell A2

=MID(A1,1,3)&"-"&MID(A1,4,3)&"-"&MID(A1,7,3)&"a"

because you are adding a character at the end, it has to be a text field. I
hope this helps

Roger


"Greg Brow" wrote in message
...
Hi all

I have a series of numbers 123456789 and it is followed with a letter a

I need to show on a worksheet in this format 123-456-789a I cant work out
how to set the cell i have tried 000-000-000 but not sure how to get it to
recognise the letter after

Thanks in advance

greg




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
formatting macro help [email protected] Excel Discussion (Misc queries) 2 March 10th 09 12:53 PM
Formatting using Macro simplymidori[_2_] Excel Discussion (Misc queries) 4 April 11th 08 12:22 AM
Formatting for a Macro Maggie Excel Discussion (Misc queries) 3 February 28th 07 02:00 AM
Formatting via a macro mike_vr Excel Discussion (Misc queries) 3 November 8th 06 04:19 PM
Formatting macro jbb16x99 Excel Programming 3 October 10th 03 10:22 PM


All times are GMT +1. The time now is 10:42 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"