ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I want to make locked cells un-clickable (https://www.excelbanter.com/excel-programming/309656-i-want-make-locked-cells-un-clickable.html)

John[_95_]

I want to make locked cells un-clickable
 
What is the VBA command to do this? I want to be able to just tab over
to unlocked cells and skip locked cells completely.

I knew how to do this once, but I must have learned something new
which crowded out that bit of knowledge. Thanks for your help.

-John L.

Paul B[_6_]

I want to make locked cells un-clickable
 
John, here is one way, put in thisworkbook code

Private Sub Workbook_Open()
'will not let you select locked cells
'This is a setting that Excel doesn't remember between closings,
'that is why it in the workbook open event

'change to your sheet name
With Worksheets("sheet1")
.Activate
.EnableSelection = xlUnlockedCells
.Protect Contents:=True, UserInterfaceOnly:=True
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
"John" wrote in message
m...
What is the VBA command to do this? I want to be able to just tab over
to unlocked cells and skip locked cells completely.

I knew how to do this once, but I must have learned something new
which crowded out that bit of knowledge. Thanks for your help.

-John L.




Sunryzz[_2_]

I want to make locked cells un-clickable
 
I tried this code in my Workbook_Open Object, but when I saved and
reopened, it asked for my password. I hit cancel (since I don't want the
user to have to enter a password) and then clicked my macro button. I
then got an error 1004 which is what I get when the sheet is protected and
I try to run a macro. I want to protect a group of cells on the sheet and
still be able to run a macro on them. I seem to be able to get many
things to do this for me until I save and close the file. Then all bets
are off!! Please help if you can.

Thanks



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

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