Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill with zero
Hi
I have a userform and the value produced from a textbox must be be 10 characters long, i.e. if a 3 digit figure is input, is there a way to precede this figure with seven zeros? Grateful for all ideas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill with zero
Long time since i used this function, but try ; string$(10-len(yourTextbox.text),"0") Rgds Rog -----Original Message----- Hi I have a userform and the value produced from a textbox must be be 10 characters long, i.e. if a 3 digit figure is input, is there a way to precede this figure with seven zeros? Grateful for all ideas. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill with zero
Format(inputvalue,"0000000000")
This will only work if it is an integer. If it is text, something like length = len(inputvalue) if length<10 then for i = 1 to 10-length inputvalue="0" & inputvalue next end if Although, there's probably a more elegant way. Jeff "Newbie" wrote in message ... Hi I have a userform and the value produced from a textbox must be be 10 characters long, i.e. if a 3 digit figure is input, is there a way to precede this figure with seven zeros? Grateful for all ideas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill in form to type Item descrictions and costs and fill in funct | Excel Worksheet Functions | |||
Edit Fill Series - How do I fill using minute increments | Excel Discussion (Misc queries) | |||
I have a list of data, fill in the gaps. FILL function won't work | Excel Discussion (Misc queries) | |||
The fill feature in Excel that gives option to fill or copy | New Users to Excel | |||
How to fill colour in Excel, it appers No fill in my computer? | Excel Discussion (Misc queries) |