PDA

View Full Version : Solved: Userform Commandbuttons query



sooty8
07-12-2008, 09:40 AM
Hi All

The attached file is taken off a large UserForm where we are using two Commandbuttons to fill 6 Textboxs is it possible to get the code onto one Commandbutton and if the Textboxes are the wrong data just click the button again for the correct data.

Is it also feasible that if the large Userform is closed on re - opening it will have retained just the data previously selected in these 6 TextBoxes.


Many Thanks

Regards

Sooty8

mdmackillop
07-12-2008, 11:48 AM
The attached file is taken off a large UserForm where we are using two Commandbuttons to fill 6 Textboxs is it possible to get the code onto one Commandbutton and if the Textboxes are the wrong data just click the button again for the correct data
Add a boolean variable changed True/False by the button. This can select which data is used to fill the textboxes

Is it also feasible that if the large Userform is closed on re - opening it will have retained just the data previously selected in these 6 TextBoxes.

You can use UserForm_Terminate to write values to the workbook, which will be used by an Initialise event.

sooty8
07-12-2008, 12:12 PM
Hi Md

Will have a go at your recomendations in the morning --if I hit a snag will come back with a reply.

Many Thanks

Sooty8

sooty8
07-14-2008, 04:41 AM
Hi Md

Forgot yesterday was Sunday -- used your suggestions -- job sorted.

Many Thanks

Sooty8