Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using a userform in which 1 of the textboxes contains a 16 digit account
number. When the user seaches for the information after entering it in, the account number returns as 1.23456789...E+15. The cells in which it is stored is formatted as number with 0 decimal places. Also, when the account number is originally entered, it is entered as 16 digits. How can I format the textbox to just show the number, no E+15, no commas, or currency? Thanks, Ed |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a little chunky but I got it to work.
I entered a long decimal string in a cell, preceded by an apostrophe to prevent Excel form autoformatting into an E+ representation. (It also works if the cell is formatted as Text and the numeric characters entered with no apostrophe.) Then in a code window I declared a public variable K as string, and wrote this code to assign the account number to K and open a Userform: Sub test() Dim Z As Byte K = ActiveCell.Value UserForm1.Show End Sub The Userform_Activate code assigns the value of K to the textbox. Can you use this? Dave O Eschew obfuscation |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There seems to be something wrong with the formatting of the cells. I tried
changing the format of the cells to be text, but in the cell it entered with the E+. Also, I have noticed that it is dropping the last number of the account and replacing it with a zero. I tried deleting the column and then inserting a new column (so that I didn't have the change the range in all my code) and then formatting the cells, that didn't work either. I may have to try assigning the account # to a different column, it's just very odd. Thanks "DaveO" wrote: This is a little chunky but I got it to work. I entered a long decimal string in a cell, preceded by an apostrophe to prevent Excel form autoformatting into an E+ representation. (It also works if the cell is formatted as Text and the numeric characters entered with no apostrophe.) Then in a code window I declared a public variable K as string, and wrote this code to assign the account number to K and open a Userform: Sub test() Dim Z As Byte K = ActiveCell.Value UserForm1.Show End Sub The Userform_Activate code assigns the value of K to the textbox. Can you use this? Dave O Eschew obfuscation |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Update:
I deleted every column after my data to the end of the spreadsheet, column IV and then formatted my column as text and now it seems to work fine. Thanks for the help. "ETLahrs" wrote: There seems to be something wrong with the formatting of the cells. I tried changing the format of the cells to be text, but in the cell it entered with the E+. Also, I have noticed that it is dropping the last number of the account and replacing it with a zero. I tried deleting the column and then inserting a new column (so that I didn't have the change the range in all my code) and then formatting the cells, that didn't work either. I may have to try assigning the account # to a different column, it's just very odd. Thanks "DaveO" wrote: This is a little chunky but I got it to work. I entered a long decimal string in a cell, preceded by an apostrophe to prevent Excel form autoformatting into an E+ representation. (It also works if the cell is formatted as Text and the numeric characters entered with no apostrophe.) Then in a code window I declared a public variable K as string, and wrote this code to assign the account number to K and open a Userform: Sub test() Dim Z As Byte K = ActiveCell.Value UserForm1.Show End Sub The Userform_Activate code assigns the value of K to the textbox. Can you use this? Dave O Eschew obfuscation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trouble formatting date | Excel Worksheet Functions | |||
textbox trouble | Excel Programming | |||
Trouble formatting | Excel Worksheet Functions | |||
I have had trouble with textbox text to worksheet | Excel Discussion (Misc queries) | |||
Textbox trouble on a user form | Excel Programming |