How do I stop a Textbox in a Userform converting numbers?

Probably a really stupid question... but how do I stop a Textbox on 
userform from removing the leading zero on a number?

eg 01234567890 becomes 123456789

--
Message posted from http://www.ExcelForum.com

0
1/23/2004 3:18:07 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
544 Views

Similar Articles

[PageSpeed] 43

Alan

You must format the cell first as text. e.g

Private Sub CommandButton1_Click()
    Range("A6").NumberFormat = "@"
    Range("A6").Value = TextBox1.Text
End Sub

Regards
Peter
>-----Original Message-----
>Probably a really stupid question... but how do I stop a 
Textbox on a
>userform from removing the leading zero on a number?
>
>eg 01234567890 becomes 1234567890
>
>
>---
>Message posted from http://www.ExcelForum.com/
>
>.
>
0
1/23/2004 3:54:38 PM
Reply:

Similar Artilces:

Auto number new vendors
I have a client that adds vendors on a regular basis and they use numeric vendor numbers. Will there ever be a way for the system to offer an option to auto number the next new vendor ID? -- Debbie Bergman GP Consultant RSM McGladrey | Phoenix, AZ Debbie, Ethotech's Next Numeric Collection can do this: http://ethotech.com/nextnum.html -- Victoria Yudin Dynamics GP MVP Flexible Solutions - home of GP Reports http://www.flex-solutions.com/gpreports.html blog: www.victoriayudin.com "Debbie Bergman" <DebbieBergman@discussions.microsoft.com> wrote in message news:13E5...

how to stop "Edit and Continue build started" after a debugging session
Hi, After stop debugging, how can I stop the process of "Edit and Continue build started"? In VC6, I usually stopped the process and then hit F5 to build the project. It's much faster that way. By stopping, I meant to hit ctrl-break. In VS2005, I didn't find such a hotkey or menu item for this purpose. Please help. Thanks. JD ...

How to produce a chart based on number of cells not values in the cells
Hi I'm using Excel 2007. I have a requirement to base a chart on the number cells rather than the values in the cell. For example, here are some values I might enter against Monday to Friday: 1,3,1,1,2 In this example, I want my (pie) chart to show that 3/5 are value 1, 1/5 is value 2 and 1/5 is value 3 (i.e. the pie chart should have 3 sections). What excel does, is split the chart into 8 sections, and shows each individual value. Any suggestions on how I might achieve this, Thanks for any help Colin You need to do some calculations in the sheet first, then plot the results: http...

Item with a negative serial number count
We just did a stock count in Geat Plains. We had a problem with one of our items. The item had a negative serial number count of two. I ended up deleting the item off of the count so I could process the stock count. How can I fix this item's serial number count to zero so it won't cause a problem next time we do a stock count? Jocelyn: You need to analyze the transactions on that item to determine why it's showing negative. Theoretically, that shouldn't happen because you shouldn't be able to consume the same serial number more than once. The analysis may help...

How do I use numbered bullets in Excel?
Is that possible to use numbered bullets inside cells in Excel? If so, how? Thanks. If you just have one bullet point in a cell you could make a custom format of bullet point character followed by # (copy the bullet symbol from the Character Map available under Windows Accessories) and apply this to your cells to make them look like bullets. If you want a proper bulleted list it would probably be better to use Insert->Object and bring in a Microsoft Word Document object where you could create a bulleted list more easily. Andrea Jones http://www.allaboutoffice.co.uk http://www.strat...

convert Access 2000 file to Word 2002
Is there an easy way? An Access file CANNOT be converted to Word. You can export a report to Word. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "Lee" <lpeavy@marlinengineering.com> wrote in message news:054b01c39351$0c6670a0$a301280a@phx.gbl... > Is there an easy way? ...

Excel Newbie-Simple Question Regarding Numbers Formats
Trying to enter positive numbers (no decimal places) into cells that start with the number zero.No luck. Tried "Help"...couldn't figure it out (after 30 minutes). Can somebody walk me through it? I'm using Excel 2000. TIA! The only way I know a number starting with zero (0) can be entered in cell without losing the 0 is to put an apostrophe before entering th number, e.g. '012345 and this will register in the cell as 012345. But then, technically this is not in a number format. This will be a text. BTW, how can a number starting with 0 not have a decimal place i...

Want to link a cell of numbers with a cell of text & can sort
I have a column of #s and a column of text. The column of text describes the column of numbers. I don't want to have to retype either column. Is it possible to LINK/CONNECT the two columns so that they will act as one unitl? If I try to merge the cells in the same row of the two different columns I lose the text. This is important because I must monthly import data and the data in the columns could either increase or decrease. Please advise. Thank YOul hi you might consider a formula. =A2&B2 if you need a space between the numbers and text.... =A2&&qu...

Money 05 can't add numbers
The identical accounts and balances shown in the portfolio selection and then on the home investing page of money do no add to hte same figure. The Investing page is incorrect. Anyone been able to teach Money 05 how to add a column of numbers? ...

Changing font in Textbox
I have a multiline textbox where I am trying to align text. How can I change the font to something like Courrier New so that I have equi-spaced letters and my text lines up ? Thanks, Ike Create the Font you need and call the SetFont(...) API for the edit control (textbox) "Ike" <rxv@hotmail.com> wrote in message news:2rNQc.13064$Jp6.4650@newsread3.news.atl.earthlink.net... > I have a multiline textbox where I am trying to align text. How can I change > the font to something like Courrier New so that I have equi-spaced letters > and my text lines up ? Thanks, Ike ...

Number formatting question
I have hundreds of rows of numbers (example 234553) it need to add a decimal to every row to make it 2345.53. Is this possible? Yes One method Put the value 100 in a blank cell. With that cell selected, Edit/Copy Select the numbers you wish to change (highlight the column) Use Edit/Paste Special and select the Divide option. HTH PC "sbhayes" <sbhayes@discussions.microsoft.com> wrote in message news:74C0C90C-6C93-4055-8983-430D97B09692@microsoft.com... > I have hundreds of rows of numbers (example 234553) it need to add a decimal > to every row to make it 2345.5...

Userform modal
I have created Userforms for timesheets with different projects appearing on a Multi page Userform. The problem is I need to show the subtotals on another Userform as the user inputs the data. i've tried everything but I can't get it to work Demo: Userform1 has a Textbox1. Userform2 has a Label1. Standard module code: Public Monitorform As UserForm2 Sub RunThis() Dim UF1 As UserForm1 Set UF1 = New UserForm1 Set Monitorform = New UserForm2 Monitorform.StartUpPosition = 0 Monitorform.Show vbModeless UF1.Show vbModeless End Sub Userform1 code: Private Sub Tex...

How do I stop the Commands from disappearing from Quick Access too
..Added commands to the quick access toolbar at work - next day they were gone Using Excel 2007. So, how do I stop the How do I stop the Commands, I added, from disappearing from Quick Access toolbar -- SherylAnne ...

dividing a number into hours and minutes
My users are entering numbers into column B. Is it possible to take the total of column B (say Row X) and divide it into hours and minutes putting the hours in Row X Column D and minuntes in Row X Column E (two seperate cells)? They are entering just numbers in multiples of 5 and usually not more than 30 minutes. Do I need to convert Column B to some form of 'time' to get close to the result I'm looking for? Is this even doable? Try this... In D1, enter =INT(B1/60) In E1, enter =MOD(B1,60) In this example, Row X is row 1. Hope this helps, Hutch &...

How can you identify folders, using folder numbers?
Hi everybody, I've searched and searched and asked in the quasi-defunct yahoo exchange newsgroup, but I've never found an answer as to how I can actually utilize the folder identification information contained in Exchange error log events. An example is as such: Event: 1173 Source: MSExchangeIS Mailbox Store Description: Error 0x6bb deleting unused restricted view from folder 1-1A42FF on database "First Storage Group\SG1 Mailbox1". It would be insanely useful if I could tell which folder 1-1A42FF is, so I can narrow down where the problem is occurring, you know?? Anyone...

generating random number as template
I need to create a form in excel that generates a unique number for each form. If anyone can assist with the best way to do this it would be great. Explain what you mean please. "Jemm" wrote: > I need to create a form in excel that generates a unique number for each > form. If anyone can assist with the best way to do this it would be great. > What you need is a Forms collection object, but in Excel that will only work for already loaded forms. So first create the collection yourself, and then browse through it. Sub CheckFormsInCollection() Dim i, u As Long, s ...

blue row numbers
I have blue row numbers and hidden rows that won't unhide but I see no evidence of grouping. There isn't any numbers at the top or anything. I can manually resize the row height but even if I save it afterwards when I go back into it the rows are hid again. Does anyone know why? And how to fix it? Do any of your columns have a dropdown arrow on them? there might be a filter applied. Go into Data>Filter, and if the Autofilter has a tick mark, click it and see if this reveals all the rows. -- HTH RP (remove nothere from the email address if mailing direct) "Grannet"...

Catching duplicate Customer PO numbers
Would like the Customer Purchase Order Number field on the Sales Order to have a character recognition format to help detect duplicate customer purchase order numbers that may be entered in error. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.co...

converting to CMYK to send to a printing co?
Don't have need of this yet, but came across it in making book covers. Publisher (2000) can convert it to CMYK which I've read is what printers want it to be. Or, they will convert it themselves (some say) If so, I would still have to send the image separately along with the overall design? It says embedded images have to be linked to the document and sent separately. The image file. I can understand this though I've never used a linked image in a document before. I put images on from my files (or clip art) (using a picture box and import, which I assume is embedding) bu...

CSV file and number formatting
Hello, I am trying to create a csv file from an excel worksheet. The proble is when I open the file in excel, I get scientific notation. I als have numbers that are supposed to be text. some of these numbers star with zero, so most of the time it is lost when converting to csv with n formatting. How can I do this -- fs ----------------------------------------------------------------------- fsm's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1486 View this thread: http://www.excelforum.com/showthread.php?threadid=26494 fsm, After saving the sheet as csv, o...

Transpose week numbers to date
Hi One of my users would like to have certain cells in his spreadsheet, where if you type a week number it will transpose it to a date. For example 01 might be 01/04/2005, 02 might be 08/04/2005 and 52 might be 25/03/2006. I am clueless on this one, and not very good at Excel anyhow Thanks in advacne Harry One way: Assume the week number is input into cell A1: B1: =DATE(2005,4,1) + 7 * (A1-1) Format the cell as a date. Note that I get 24/03/2006 rather than 25/03/2006 for A1=52. In article <27203F81-566E-4539-A116-56FA9F1219F6@microsoft.com>, "Lewej" <Lewej...

Saving Custom number formats
When I apply a custom number format to a worksheet in Excel 97 SR2 the dame format is not available in other worksheets. Is there a way of making it stick? Thanks in advance. Ian Hi Ian, Try putting the format in a blank workbook called Book1 and save this in your XLSTART folder -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in e-mail address "Ian" <anonymous@discussions.microsoft.com> wrote in message news:199a01c3fc05$2e662cf0$a501280a@phx.gbl... > When I apply a custom number format to a worksheet in > Excel 97 SR2 the dame format is not available i...

Format TextBox in UserForm
Hello I have a userform which contains textboxes with calculations. For example, I have a statement that requires the user to input data to be used to calculate inventory turns. Once the data is entered, a formula will calculate the number of inventory turns and will display in a separate textbox. Is there a way to format the textbox so the formula is in "comma" style? Currently, the calculation returns 5 or 6 places to the left of the decimal. Is there a better control other than a "textbox" to perform this calculation or is there a way to format the textbox to show ...

How do I access the Microsoft Word Recover Text Converter?
How do I access the Microsoft Word Recover Text Converter? I have some corrupted word files which have taken plenty of time to produce and need to repair them. I have already installed Recover Text Converter. http://www.word-recovery.info/install-converter.html -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Captain Raymond" <Captain Raymond@discussions.microsoft.com> wrote in message news:DC46474F-F0AF-41B0-B16B-2D1538C3941F@microsoft.com... > How do I access the Microsoft Word Recover Text C...

Viewing Page numbers
On my worksheet screen view, there is a large gray "Page 1" showing, but does not print, or show in print preview. How do I turn this off? I don't need to see it. view>normal -- Don Guillett SalesAid Software donaldb@281.com "Janet" <Janet@discussions.microsoft.com> wrote in message news:600D5532-86E4-4531-93F3-2CAC8A3C7646@microsoft.com... > On my worksheet screen view, there is a large gray "Page 1" showing, but does > not print, or show in print preview. How do I turn this off? I don't need > to see it. View > Normal HT...