Help vba unlock and relock cells

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,141
Office Version
  1. 365
Platform
  1. Windows
Can anyone suggest a way to unlock a range of single cells
let me do some work
and then re lock them again

Starting from P11
every 6 columns right till AZ11
and every 7 rows down to the last row (around 13000ish)


eg.
P11, V11, AB11.....AZ11
P15, V15, AB15.....AZ15
.
.
.etc

I could ctrl click/every one :eek:
format
protection
unlock

do my work then start over, but I think thats gonna cause RSI and i need my hand for other things, like raising a toast to the guys on this forum

Oh please let there be an answer!!

Martin
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Maybe try:

Code:
Sub Test()
 
Dim lastRow As Long, myRow As Long, myCol As Long
lastRow = Cells(Rows.Count, "P").End(xlUp).Row
For myRow = 11 To lastRow Step 7
    For myCol = 16 To 52 Step 6
        Cells(myRow, myCol).Locked = False
    Next myCol
 
Next myRow
End Sub

You did say every 7 rows but your example suggests different so double check before running.

Dom
 
Upvote 0
Whoa and that was so short too.
Thanks Dom, I will double check and adjust step if necessary

Martin
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top