ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loading a Userform (https://www.excelbanter.com/excel-programming/396102-loading-userform.html)

chad

Loading a Userform
 
I have a userform I'm using to prompt the user to update a list where the
data is held in a worksheet. Each time the user presses the "update" button
in the book, the userform for the udpate is accessed via userform.show. On
initializaion, I use a list box that adds items based on the underlying data
sheet. The problem I'm having is that if I use the form once and add new
data to the sheet, if a user accesses the userform again, the data does not
"reload" from scratch, pulling into the listbox the most recently added data.


So, basically, I'm needing help in using listbox1.AddItem on initialization
for a userform to "load" new data from a worksheet each and every time the
userform is accessed. Any thoughts?

Thanks in advance,
Chad

joel

Loading a Userform
 
Before loading new data you have to clear the listbox

Userform1.listobx1.Clear

"Chad" wrote:

I have a userform I'm using to prompt the user to update a list where the
data is held in a worksheet. Each time the user presses the "update" button
in the book, the userform for the udpate is accessed via userform.show. On
initializaion, I use a list box that adds items based on the underlying data
sheet. The problem I'm having is that if I use the form once and add new
data to the sheet, if a user accesses the userform again, the data does not
"reload" from scratch, pulling into the listbox the most recently added data.


So, basically, I'm needing help in using listbox1.AddItem on initialization
for a userform to "load" new data from a worksheet each and every time the
userform is accessed. Any thoughts?

Thanks in advance,
Chad


chad

Loading a Userform
 
Do i simply use listbox1.clear or what?

Thanks,
Chad

"Joel" wrote:

Before loading new data you have to clear the listbox

Userform1.listobx1.Clear

"Chad" wrote:

I have a userform I'm using to prompt the user to update a list where the
data is held in a worksheet. Each time the user presses the "update" button
in the book, the userform for the udpate is accessed via userform.show. On
initializaion, I use a list box that adds items based on the underlying data
sheet. The problem I'm having is that if I use the form once and add new
data to the sheet, if a user accesses the userform again, the data does not
"reload" from scratch, pulling into the listbox the most recently added data.


So, basically, I'm needing help in using listbox1.AddItem on initialization
for a userform to "load" new data from a worksheet each and every time the
userform is accessed. Any thoughts?

Thanks in advance,
Chad


joel

Loading a Userform
 
It is the same method you are using to add items. Listbox1.clear should
work. You are using listbox1.add already.

"Chad" wrote:

Do i simply use listbox1.clear or what?

Thanks,
Chad

"Joel" wrote:

Before loading new data you have to clear the listbox

Userform1.listobx1.Clear

"Chad" wrote:

I have a userform I'm using to prompt the user to update a list where the
data is held in a worksheet. Each time the user presses the "update" button
in the book, the userform for the udpate is accessed via userform.show. On
initializaion, I use a list box that adds items based on the underlying data
sheet. The problem I'm having is that if I use the form once and add new
data to the sheet, if a user accesses the userform again, the data does not
"reload" from scratch, pulling into the listbox the most recently added data.


So, basically, I'm needing help in using listbox1.AddItem on initialization
for a userform to "load" new data from a worksheet each and every time the
userform is accessed. Any thoughts?

Thanks in advance,
Chad


chad

Loading a Userform
 
Perfect, thanks!


"Joel" wrote:

It is the same method you are using to add items. Listbox1.clear should
work. You are using listbox1.add already.

"Chad" wrote:

Do i simply use listbox1.clear or what?

Thanks,
Chad

"Joel" wrote:

Before loading new data you have to clear the listbox

Userform1.listobx1.Clear

"Chad" wrote:

I have a userform I'm using to prompt the user to update a list where the
data is held in a worksheet. Each time the user presses the "update" button
in the book, the userform for the udpate is accessed via userform.show. On
initializaion, I use a list box that adds items based on the underlying data
sheet. The problem I'm having is that if I use the form once and add new
data to the sheet, if a user accesses the userform again, the data does not
"reload" from scratch, pulling into the listbox the most recently added data.


So, basically, I'm needing help in using listbox1.AddItem on initialization
for a userform to "load" new data from a worksheet each and every time the
userform is accessed. Any thoughts?

Thanks in advance,
Chad



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

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