I want to halt the event which writes the value in a
text box to the range specified by the ControlSource
property of that object. I want the object to read the
value from the cell but not to update it.
Chrissy.
Tom Ogilvy wrote
For excel objects, you can use
Application.EnableEvents = False
Application.EnableEvents = True
this would include worksheet, workbook and application level events.
MSforms controls are not Excel objects, so they are not affected by this
setting, nor do they have an equivalent setting. You can, of course
establish a test at the start of the event to look at a flag variable to
signify whether to execute the event code or bail out.
It was unclear to me which events you wanted to halt.
Regards,
Tom Ogilvy
Chrissy wrote in message
...
Tom Ogilvy wrote
There is no automatic connection between cells and controls other than
the
controlsource. So code is really the only option for harvesting values
from
cells with formulas.
I think you would have to key off the calculate event in the worksheet -
however, if the only thing that would make the sums change is user
entries
in your userform, then perhaps you could key off that.
I would be nice if there was a control which had a write control source
property
and a read control source property. That way you could have three
controls
where one was the total of the other two and the values are automatically
displayed and saved just because the user entered a value in a cell.
The other way would be to stop events running - then I could stop the
standard events running - is there a way to do this?
When talking about user, it is generally more helpful/clearer to say
userform rather than just form as form could refer to simulation of a
paper
form on a worksheet or you could be talking about a form in VB.
Ok - will do from now on.
Chrissy.