Buttons shrinking and checkboxes swelling...
First, if you have controls (like commandbuttons from the control toolbox
toolbar) and if you replaced them with buttons from the Forms toolbar, code for
these would have to modified and moved to a general module. Then you'd assign
the macro (in that general module) to the button. (Rightclick on the button and
choose assign macro.)
But if you're only using controls like checkboxes for an indicator, you could
replace them with checkboxes from the Forms toolbar.
Your code would have to change to something like:
latency = iif(cbool(me.checkboxes("cbpower").value = xlon), _
me.range("Pourfactor").value, 0)
I don't like the iif statement. It turns out that it's slower than the a
"normal" if:
latency = 0
if me.checkboxes("cbpower").value = xlon then
latency = me.range("pourfactor").value
end if
Since I used the Me keyword, this code assumes that the code is still in the
worksheet module.
If I wanted to refer to the checkbox in a general module, I could use:
dim wks as worksheet
set wks = activesheet 'or worksheets("whatever")
if wks.checkboxes("cbpower").value = xlon then
...
==========
Just think of all the people who spend 1000's of dollars on new cars. And find
the little (and sometimes major) problems.
Every complex technology is going to have bugs--including excel.
Geoff wrote:
Thanks Dave.
Since they are integral to code that I have, the ActiveX Controls are the
way to go or so I was told in a previous thread. I've tried using Form
controls and if I name them the same as the ActiveX controls, the code
doesn't recognize them. I'm sure there's a way to refer to them in VBA, but I
don't know how.
For example, I have a check box, cbPower that I refer to:
Latency = IIf(cbPower, Range("PourFactor"), 0)
If I change it to a Form control called cbPower, when the code runs it kind
of scratches its head and tells me there is no such object or something like
that.
So, what's going on her? Do I need to use controls that are not as suitable
for my needs because Microsoft software is kludgy? I mean come on, I paid
several hundred dollars for this. I should expect one of the main features to
work properly, right?
"Dave Peterson" wrote:
Lots of people have said that if they deleted the controls and re-added them,
the problem went away (at least temporarily!).
I find that the controls from the Forms toolbar are much better behaved. I bet
you're using controls from the Control Toolbox toolbar.
If you don't need all the features that the controls from Control toolbox
toolbar provide, you may want to replace them with the controls from the Forms
toolbar.
Geoff wrote:
WT heck...do I have some kind of disease? As I'm using a button, I am
watching it as it disappears away to nothing. In time, it will have collapsed
into a singularity and I fear for the future of the planet. Should I call
CERN?
And my check boxes are growing with every click. Is this just more evidence
for the accelerating expansion of space-time?
Seriously...wt heck. I've set them all to not move or size with cells
(though the cells are not moving and resizing anyway).
--
Dave Peterson
.
--
Dave Peterson
|