View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jock Jock is offline
external usenet poster
 
Posts: 440
Default padding cell with up to 3 zeros

That'll do nicely - Thanks Rick
--
Traa Dy Liooar

Jock


"Rick Rothstein" wrote:

If you use this Custom Formatting pattern...

"09/"0000

Then the cells you apply it to will **display** the user's entries as you
want them to appear; so, if your user enters 55 in the cell, it will display
as 09/0055. Note, however, that the entry in the cell will still be 55... it
will only **look** like 09/0055. Is that what you were after, or did you
want to physically change the entry to actually be 09/0055? If so, that will
require VB code.

--
Rick (MVP - Excel)


"Jock" wrote in message
...
I need users to input a four digit number between 0001 and 9999 in cells in
column "B".
Rather than forcing the user to enter leading zeros, is there a way,
either
using code or formula, to automate the process meaning the user can input
"55" for instance, and Excel will automatically add the two leading zeros?
I have also set up a 'Custom' number type (format cells) which will place
"09/" in front of each entry in column "B". This would need to be taken
into
account.
Example - 09/0055

Thanks,
--
Traa Dy Liooar

Jock