#1   Report Post  
Nick
 
Posts: n/a
Default Custom Format

Hi,

Done a bit of Googling but no luck so far...

What I need to do is create a Custom cell format for the following:


xxx##-########

Where the x's are any letter and the #'s are numbers. For example, if the user inputs:

SHA11-1234

The Cell will automatically be formatted as:

SHA11-00001234

Can this be done?

Cheers,
Nick


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Not by using number format. (Number format works with numbers--not text.)

But maybe you could use a helper cell to translate it:

=IF(A1="","",
Upper(LEFT(A1,6))&RIGHT(REPT("0",8)&MID(A1,SEARCH( "-",A1)+1,255),8))

(all one cell)




Nick wrote:

Hi,

Done a bit of Googling but no luck so far...

What I need to do is create a Custom cell format for the following:

xxx##-########

Where the x's are any letter and the #'s are numbers. For example, if the user inputs:

SHA11-1234

The Cell will automatically be formatted as:

SHA11-00001234

Can this be done?

Cheers,
Nick


--

Dave Peterson
  #3   Report Post  
Nick
 
Posts: n/a
Default

Thanks Dave - shame about that though... maybe I'll just use my old format function in VB...

Cheers!
-Nick

"Dave Peterson" wrote in message
...
Not by using number format. (Number format works with numbers--not text.)

But maybe you could use a helper cell to translate it:

=IF(A1="","",
Upper(LEFT(A1,6))&RIGHT(REPT("0",8)&MID(A1,SEARCH( "-",A1)+1,255),8))

(all one cell)




Nick wrote:

Hi,

Done a bit of Googling but no luck so far...

What I need to do is create a Custom cell format for the following:

xxx##-########

Where the x's are any letter and the #'s are numbers. For example, if the user inputs:

SHA11-1234

The Cell will automatically be formatted as:

SHA11-00001234

Can this be done?

Cheers,
Nick


--

Dave Peterson



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

You could use an event macro that actually changes the value.



Nick wrote:

Thanks Dave - shame about that though... maybe I'll just use my old format function in VB...

Cheers!
-Nick

"Dave Peterson" wrote in message
...
Not by using number format. (Number format works with numbers--not text.)

But maybe you could use a helper cell to translate it:

=IF(A1="","",
Upper(LEFT(A1,6))&RIGHT(REPT("0",8)&MID(A1,SEARCH( "-",A1)+1,255),8))

(all one cell)




Nick wrote:

Hi,

Done a bit of Googling but no luck so far...

What I need to do is create a Custom cell format for the following:

xxx##-########

Where the x's are any letter and the #'s are numbers. For example, if the user inputs:

SHA11-1234

The Cell will automatically be formatted as:

SHA11-00001234

Can this be done?

Cheers,
Nick


--

Dave Peterson


--

Dave Peterson
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
Custom Cell Format Will Not Save Correctly szyzygy Excel Worksheet Functions 3 July 21st 05 11:55 PM
Custom percent format needed Will Fleenor Excel Worksheet Functions 1 June 29th 05 02:57 AM
Cell will not format numbers correctly for a 13 digit custom barc. Laudan Excel Worksheet Functions 4 April 11th 05 08:13 PM
Keep custom format in new worksheet Buddy Excel Discussion (Misc queries) 2 March 14th 05 10:03 AM
How do I format a cell for a custom part number? PJ Excel Discussion (Misc queries) 4 March 3rd 05 03:57 AM


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