Control Source Property

  • Thread starter Thread starter donh
  • Start date Start date
D

donh

Hi Group,

I'm using the control source property in VBA to link a form text box
to a worksheet cell. Although this works I have found that the
worksheet cell is overwritten by the form textbox (even if not updated
within the form, I set the locked property to true) when the form
closes. The problem being that the worksheet cell data is a lookup
formula and not just plain text! So each time it closes I lose my
formula!

Can someone point me in the right direction please.


Thanks in anticipation


DonH
 
If you want to retrieve the value from the cell for use in the userform, then
use code to grab the contents.

Maybe in the userform_initialize procedure:

me.textbox1.value = worksheets("sheet9999").range("a999").text

If you want to put the value from the textbox back to the cell, then you're
going to lose the formula.
 
If you want to retrieve the value from the cell for use in the userform, then
use code to grab the contents.

Maybe in the userform_initialize procedure:

me.textbox1.value = worksheets("sheet9999").range("a999").text

If you want to put the value from the textbox back to the cell, then you're
going to lose the formula.










--

Dave Peterson- Hide quoted text -

- Show quoted text -

Thank you Dave, I shall give that a try. I've been having a go using
ListBox's instead. They seem to work, but don't know if I'm building
up more problems using them.

Thanks again.

DonH
 
Back
Top