Control Source Property

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
 
D

Dave Peterson

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.
 
D

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.










--

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top