Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default 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   Report Post  
Posted to microsoft.public.excel.programming
rog rog is offline
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default 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
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
Fill in form to type Item descrictions and costs and fill in funct cradino Excel Worksheet Functions 0 July 16th 06 08:44 PM
Edit Fill Series - How do I fill using minute increments IUnknown Excel Discussion (Misc queries) 1 January 29th 06 12:50 PM
I have a list of data, fill in the gaps. FILL function won't work Triv Excel Discussion (Misc queries) 1 September 17th 05 02:33 PM
The fill feature in Excel that gives option to fill or copy KAHelman New Users to Excel 1 July 29th 05 07:47 PM
How to fill colour in Excel, it appers No fill in my computer? bede Excel Discussion (Misc queries) 1 June 11th 05 03:27 AM


All times are GMT +1. The time now is 04:00 AM.

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"