ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Display of control check boxes and option buttons (https://www.excelbanter.com/excel-programming/409488-display-control-check-boxes-option-buttons.html)

brg

Display of control check boxes and option buttons
 
I am having a problem with the display of control check boxes and option
buttons reflecting the value of their linked cells.

I have a VB macro that goes in and changes the value of the cells that
controls are linked to. When the value has been changed, some controls
(usually the ones in the first couple of rows on the sheet) will update their
display to reflect the (new) value of their linked cell, while the rest
retain the display they had before the change.

Any ideas on what could cause this? Do I need (or is it possible) to tell
the control objects to update their displays to reflect the value of their
cells?

In case this has some bearing, I turn ScreenUpdating off before the
copy/paste and back on again afterwards, and I use
Worksheets().Range().FormulaR1C1 = Worksheets().Range().FormulaR1C1 for the
copy/paste.

--
BRG

Jim Rech[_2_]

Display of control check boxes and option buttons
 
I have seen this problem but so long ago I'm not sure what the solution was.
I'd guess it's to set the value of the control directly:

Sheet1.CheckBoxes("Check box 1").Value = True

This is for a Forms toolbar check box. You didn't mention which kind you're
using.

--
Jim
"BRG" wrote in message
...
I am having a problem with the display of control check boxes and option
buttons reflecting the value of their linked cells.

I have a VB macro that goes in and changes the value of the cells that
controls are linked to. When the value has been changed, some controls
(usually the ones in the first couple of rows on the sheet) will update
their
display to reflect the (new) value of their linked cell, while the rest
retain the display they had before the change.

Any ideas on what could cause this? Do I need (or is it possible) to tell
the control objects to update their displays to reflect the value of their
cells?

In case this has some bearing, I turn ScreenUpdating off before the
copy/paste and back on again afterwards, and I use
Worksheets().Range().FormulaR1C1 = Worksheets().Range().FormulaR1C1 for
the
copy/paste.

--
BRG




brg

Display of control check boxes and option buttons
 
Hey Jim, thanks for the response.

I'm using checkboxes and option buttons from the control toolbar. The
buttons (and their linked cells) already have the values I want them to keep.
The problem is that with the cells locked, when you try to select say an
option button, an error pops up, the display of the button goes from
'selected' to 'not selected' or visa versa (which I don't want), but the
value of the linked cell doesn't change(which I want).

I want to either prevent the display of the button from changing, or find
some way to instruct all buttons and boxes to reflect the value that's in
their linked cells.

Thanks
--
BRG


"Jim Rech" wrote:

I have seen this problem but so long ago I'm not sure what the solution was.
I'd guess it's to set the value of the control directly:

Sheet1.CheckBoxes("Check box 1").Value = True

This is for a Forms toolbar check box. You didn't mention which kind you're
using.

--
Jim
"BRG" wrote in message
...
I am having a problem with the display of control check boxes and option
buttons reflecting the value of their linked cells.

I have a VB macro that goes in and changes the value of the cells that
controls are linked to. When the value has been changed, some controls
(usually the ones in the first couple of rows on the sheet) will update
their
display to reflect the (new) value of their linked cell, while the rest
retain the display they had before the change.

Any ideas on what could cause this? Do I need (or is it possible) to tell
the control objects to update their displays to reflect the value of their
cells?

In case this has some bearing, I turn ScreenUpdating off before the
copy/paste and back on again afterwards, and I use
Worksheets().Range().FormulaR1C1 = Worksheets().Range().FormulaR1C1 for
the
copy/paste.

--
BRG






All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com