ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Force to update textbox value to cell (https://www.excelbanter.com/excel-programming/425838-force-update-textbox-value-cell.html)

Ueli Werner

Force to update textbox value to cell
 
Hi there

Today I wrote something about frames and textboxes and the exit event of the
textbox which is not called, when I leave the form.

Now I have another question:

I like to force the textbox to update the value to the cell which is defined
in ControlSource.

Can I do this in a simple way?

I have an idea but it is very complicated:

0. Remove the controlsource of the textbox
1. Rembember which Textbox is entered in the Enter-Event of the Textbox
2. Create a procedure to write down the value of the textbox manually to the
cell (I don't like this!!!!!)
3. Handle the Exit-Event of the textbox an call the procedure in 2.
4. Handle the Exit-Event of the Frame-Exit and call the procedure in 2.

On this idea I don't like to write code to manually set the textbox value
into the cell. If I could call something like Update or whatever it would be
great, but I don't know excel (or vba) that good.

Thanks alot.

Ueli


Per Jessen

Force to update textbox value to cell
 
Hi Ueli

Maybe:

Userform1.Repaint

Regards,
Per

"Ueli Werner" skrev i meddelelsen
...
Hi there

Today I wrote something about frames and textboxes and the exit event of
the textbox which is not called, when I leave the form.

Now I have another question:

I like to force the textbox to update the value to the cell which is
defined in ControlSource.

Can I do this in a simple way?

I have an idea but it is very complicated:

0. Remove the controlsource of the textbox
1. Rembember which Textbox is entered in the Enter-Event of the Textbox
2. Create a procedure to write down the value of the textbox manually to
the cell (I don't like this!!!!!)
3. Handle the Exit-Event of the textbox an call the procedure in 2.
4. Handle the Exit-Event of the Frame-Exit and call the procedure in 2.

On this idea I don't like to write code to manually set the textbox value
into the cell. If I could call something like Update or whatever it would
be great, but I don't know excel (or vba) that good.

Thanks alot.

Ueli




All times are GMT +1. The time now is 10:07 PM.

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