ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refreshing a userform/listbox (https://www.excelbanter.com/excel-programming/357883-refreshing-userform-listbox.html)

toocold[_11_]

Refreshing a userform/listbox
 

Good morning.

I almost have my problem with listboxes sorted out(see Transfering
between listboxes). The Add and Remove buttons are working perfectly.
The only problem remaining... at least until I try to get the
information from the userform to the worksheet... is that I have a
button which allows user to expand on the number of options.

For clearity, the listbox allows 12 options. 7 are predefined in the
listbox, 5 my be added by the user by pressing a button. This button
calls a new userform for the user to enter the additional options. The
problem is that when the user returns to the original userform, the
listbox has not updated for the new options. This was working properly
before when I had the RowSource for the listbox set as the range that I
wanted but now that I am populating the listbox using the
Userform_Initialize procedure, this is not working any more.

How can I force a refresh of my userform... or have it reinitialize?
Right now the code for the second userform is pretty simple... once
they have entered in the options they want, there is a command button
with the following code.

Private Sub BTNReturn_Click()

Options.hide
Selectoptions.show

End Sub

Any ideas?
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=529287


Vasant Nanavati

Refreshing a userform/listbox
 
Have you tried unloading and reloading the first UserForm, rather than
hiding and unhiding it?



"toocold" wrote in
message ...

Good morning.

I almost have my problem with listboxes sorted out(see Transfering
between listboxes). The Add and Remove buttons are working perfectly.
The only problem remaining... at least until I try to get the
information from the userform to the worksheet... is that I have a
button which allows user to expand on the number of options.

For clearity, the listbox allows 12 options. 7 are predefined in the
listbox, 5 my be added by the user by pressing a button. This button
calls a new userform for the user to enter the additional options. The
problem is that when the user returns to the original userform, the
listbox has not updated for the new options. This was working properly
before when I had the RowSource for the listbox set as the range that I
wanted but now that I am populating the listbox using the
Userform_Initialize procedure, this is not working any more.

How can I force a refresh of my userform... or have it reinitialize?
Right now the code for the second userform is pretty simple... once
they have entered in the options they want, there is a command button
with the following code.

Private Sub BTNReturn_Click()

Options.hide
Selectoptions.show

End Sub

Any ideas?
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile:
http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=529287




toocold[_12_]

Refreshing a userform/listbox
 

yup, it doesn't refresh the listbox.

Any other ideas?
Thanks,
d

--
toocol
-----------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...fo&userid=3160
View this thread: http://www.excelforum.com/showthread.php?threadid=52928


Rick Hansen

Refreshing a userform/listbox
 
Hey TooCool,
How are trying pass the values back form UserForm2 back to UserForm1 ?

Rick




"toocold" wrote in
message ...

Good morning.

I almost have my problem with listboxes sorted out(see Transfering
between listboxes). The Add and Remove buttons are working perfectly.
The only problem remaining... at least until I try to get the
information from the userform to the worksheet... is that I have a
button which allows user to expand on the number of options.

For clearity, the listbox allows 12 options. 7 are predefined in the
listbox, 5 my be added by the user by pressing a button. This button
calls a new userform for the user to enter the additional options. The
problem is that when the user returns to the original userform, the
listbox has not updated for the new options. This was working properly
before when I had the RowSource for the listbox set as the range that I
wanted but now that I am populating the listbox using the
Userform_Initialize procedure, this is not working any more.

How can I force a refresh of my userform... or have it reinitialize?
Right now the code for the second userform is pretty simple... once
they have entered in the options they want, there is a command button
with the following code.

Private Sub BTNReturn_Click()

Options.hide
Selectoptions.show

End Sub

Any ideas?
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile:

http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=529287





All times are GMT +1. The time now is 11:18 AM.

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