+ Reply to Thread
Results 1 to 4 of 4

Custom Format

  1. #1
    Nick
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: Custom Format

    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. #3
    Nick
    Guest

    Re: Custom Format

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

    Cheers!
    -Nick

    "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    news:43009083.BBBDFA2C@verizonXSPAM.net...
    > 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. #4
    Dave Peterson
    Guest

    Re: Custom Format

    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" <petersod@verizonXSPAM.net> wrote in message
    > news:43009083.BBBDFA2C@verizonXSPAM.net...
    > > 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 to 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