View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default controlsource cells in listobox

Controls on a userform don't have a linked cell property. The linked cell
property on a worksheet is provided by the container: the OLEObject. On a
userform, the Control is the container. The property it provides for this
is named ControlSource. So controlsource on a userform control is
identical in purpose to the linkedcell property in a worksheet activeX
control.

to the best of my knowledge, when you unload a userform, the value in
"linked" cells is not altered. However, if you have code in your userform
that clears the values in the controls or in this case, changes the
selection in the Listbox, then this could cause this problem. Or if you
hide the userform and then the values in the RowSource in the worksheet for
these boxes is altered, it could cause this problem.

If you are hiding the userform, try unloading it.

--
regards,
Tom Ogilvy



wrote in message
ups.com...
hi,
i have created two listboxes in excel such that the choices in the
second listbox are dependant on the what is chosen in the first. for
each listbox i have set the 'controlsource' property to a cell in my
worksheet so that the choices are displayed on the sheet once the
userform is closed. the only problem is that these cells clear as soon
as any new data is entered into the worksheet. these listboxes were
created in vba, not through the add control option...so i don't see any
'linkedcell' property. how can i get the choices made to stay static
after the userform has been closed. appreciate the help. i'm a newbie
so i'm sure it is a simple fix. thank you. btw i'm using excel 2002