ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Validating values in textboxes (https://www.excelbanter.com/excel-programming/421106-validating-values-textboxes.html)

don H. Lee

Validating values in textboxes
 
Hi Newsgroup

I have a little problem.

In my form I have several field which are directly connected to a cell with
controlsource.

For formatting and optical reasons I wrote some functions in vba to format
the values to a 'better' viewing like Format(myval,"000'000.000").

Now I put this on the event Exit of the textbox but I realized, that this is
to late, because it ist not taken into the cell. Putting this on the Change
Event will cause difficulties. And I cannot find a event like validate.

Has some expiriences in using textboxes which have a controlsource and
formatting them proper?

Thanks for every help.

Regards

D. H. Lee



Jim Rech

Validating values in textboxes
 
You probably do not want to change course in your design but my preference
is to not use ControlSource at all. Rather I use the Initialize event to
load the data into the userform and the Terminate or QueryClose events to
put data back in the worksheet. You get a lot more control that way.

--
Jim
"don H. Lee" wrote in message
...
| Hi Newsgroup
|
| I have a little problem.
|
| In my form I have several field which are directly connected to a cell
with
| controlsource.
|
| For formatting and optical reasons I wrote some functions in vba to format
| the values to a 'better' viewing like Format(myval,"000'000.000").
|
| Now I put this on the event Exit of the textbox but I realized, that this
is
| to late, because it ist not taken into the cell. Putting this on the
Change
| Event will cause difficulties. And I cannot find a event like validate.
|
| Has some expiriences in using textboxes which have a controlsource and
| formatting them proper?
|
| Thanks for every help.
|
| Regards
|
| D. H. Lee
|
|



All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com