Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Textbox Formatting Trouble

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Textbox Formatting Trouble

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Textbox Formatting Trouble

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Textbox Formatting Trouble

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
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
Trouble formatting date geordy67 Excel Worksheet Functions 6 July 27th 06 02:30 AM
textbox trouble Craig[_21_] Excel Programming 6 September 10th 05 07:35 AM
Trouble formatting Jane Excel Worksheet Functions 1 May 17th 05 05:30 PM
I have had trouble with textbox text to worksheet Thomas Excel Discussion (Misc queries) 1 March 10th 05 03:23 AM
Textbox trouble on a user form Oreg[_3_] Excel Programming 7 May 27th 04 12:36 AM


All times are GMT +1. The time now is 05:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"