(Actually, the title should be: UNlocking Table Columns Isn't Working)
I have a table where I want certain columns protected and other columns unprotected. I used an instruction like this:
Range("Table1[[#ALL],[Column1]:[Column4]]").Locked = False
But after it runs, the cells there are still locked. I experimented by adding some Watches, and discovered that this could happen:
Range("Table1[[#ALL],[Column1]:[Column4]]").Locked FALSE
Range("A1:A5").Locked TRUE
Yes, A1:A5 is within the columns of the table that should be unlocked. So those cells can be locked although the column is not.
Furthermore, I tried
Range("Table1[[#ALL],[Column1]:[Column4]]").Locked = True
which should have locked all the cell in the column, but I wound up with this in the Watch window:
Range("Table1[[#ALL],[Column1]:[Column4]]").Locked NULL
In other words, setting the Locked property of table columns doesn't actually do anything.
I wanted to identify the columns because I'm using this macro on different tables with different numbers of rows. But it looks like I'll have to identify those columns as an ordinary range.
What's the best way to do that?
Bookmarks