ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LinkedCell (https://www.excelbanter.com/excel-programming/440585-linkedcell.html)

sarndt

LinkedCell
 
I have a MSForm Checkbox on a worksheet that uses a linkedcell to update a
cell on the worksheet. The sheet is protected and the cell is locked. In a
class module, when the change event is triggered for the checkbox, I
unprotect the form, and turn off enableevents. But I keep getting a cell
protected message on the linkedcell. I tried unlocking the cell in the
change event, but I still get the message and then the code finishes
succesfully.

How should I handle the lock issue? I thought about removing the linkedcell
setting and setting it in the event (it's currently set in properties of the
checkbox) but I don't have anywhere to store the cell info that I would put
in the linkedcell field.

Thanks

Steve



Dave Peterson

LinkedCell
 
I'd use a linked cell on a different sheet (unlocked if that worksheet is
protected).

Then use a formula in the other sheet that returns the value to the cell.

='Hidden Sheet Name Here'!a1



sarndt wrote:

I have a MSForm Checkbox on a worksheet that uses a linkedcell to update a
cell on the worksheet. The sheet is protected and the cell is locked. In a
class module, when the change event is triggered for the checkbox, I
unprotect the form, and turn off enableevents. But I keep getting a cell
protected message on the linkedcell. I tried unlocking the cell in the
change event, but I still get the message and then the code finishes
succesfully.

How should I handle the lock issue? I thought about removing the linkedcell
setting and setting it in the event (it's currently set in properties of the
checkbox) but I don't have anywhere to store the cell info that I would put
in the linkedcell field.

Thanks

Steve


--

Dave Peterson

sarndt

LinkedCell
 
I actually found a way to do it - I don't show the caption for the checkbox
on the worksheet. So I just set the caption to be the linkedcell value and
then did a range value equation using the linkedcell value in the checkbox
caption. It updates properly now when I am in the change event for the
checkbox...

"Dave Peterson" wrote:

I'd use a linked cell on a different sheet (unlocked if that worksheet is
protected).

Then use a formula in the other sheet that returns the value to the cell.

='Hidden Sheet Name Here'!a1



sarndt wrote:

I have a MSForm Checkbox on a worksheet that uses a linkedcell to update a
cell on the worksheet. The sheet is protected and the cell is locked. In a
class module, when the change event is triggered for the checkbox, I
unprotect the form, and turn off enableevents. But I keep getting a cell
protected message on the linkedcell. I tried unlocking the cell in the
change event, but I still get the message and then the code finishes
succesfully.

How should I handle the lock issue? I thought about removing the linkedcell
setting and setting it in the event (it's currently set in properties of the
checkbox) but I don't have anywhere to store the cell info that I would put
in the linkedcell field.

Thanks

Steve


--

Dave Peterson
.



All times are GMT +1. The time now is 09:28 AM.

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