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

I have several userforms built with about 60 textboxes. I have the textboxes
bound to cells on a worksheet usung the controlsource property. I have also
created a class module for all the textboxes so that events can occurr inside
of one code for all of them. In the class moduel I have the textboxes
formatted with the Change event with the following code:

Public WithEvents textgroup As MSForms.TextBox

Private Sub textgroup_Change()
textgroup.Value = Format(textgroup.Value, "Standard")
End Sub

This works fine when the form first loads, the values from the linked cells
load into the form and they are formatted properly. However, when the user
goes to change a value it will only let them enter 3 digits. The format seems
to only allow entry of numbers after the decimal point. I've tried using
other events to handle the format such as AfterUpdate and Exit and they
either do not work or they are unavailable to the new class. Is there any
way to make this work? The only other way that I can think of is to write a
separate format code for each textbox, and needless to say that would take a
while and make the code rather sloppy. I would greatly appreciate any help
anyone can offer.

Thanks

Henry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with Formatting Textboxes


Have you tried something like :-
textgroup.Value = Format(textgroup.Value, "###,###.00"

--
Brian

-----------------------------------------------------------------------
BrianB's Profile: http://www.excelforum.com/member.php...tinfo&userid=5
View this thread: http://www.excelforum.com/showthread.php?threadid=37664

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
Axes values changes autmatically / textboxes lose formatting Anand Nichkaode Charts and Charting in Excel 5 March 28th 08 04:30 PM
Problem - Shapes.Textboxes JMay Excel Discussion (Misc queries) 2 April 22nd 07 10:28 PM
textboxes problem? Liedson31 Excel Programming 7 May 5th 05 01:20 AM
intermittent problem with clearing textboxes on forms Renae[_2_] Excel Programming 0 October 7th 04 03:57 AM
problem when drawing textboxes in excel using macro Chris Lannoo Excel Programming 0 June 23rd 04 12:55 PM


All times are GMT +1. The time now is 06:31 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"