Hi Guys,
I wanted to have a piece of code that could that would create a toggle for Lock and Unlock for a range of cells.
The code below unprotects the sheet so that I can set the protection for the range and then re-protects the sheet.
Is there an If and Else command to say IF range (A8:B20) is locked then unlock ELSE lock?
The reason I need this is that I have a budget spreadsheet and I may need to change the descriptions and price values of those ranges without having the rest of the worksheet vulnerable to being unlocked.
Can someone help me out please, below is the code I have so far I just need the blanks filled in where it says 'My Code starts here'
Thanks in advance. 
Sub Protectsheet()
Dim Rng As Range
Set Rng = Range("A8:B20")
Sheet1.Unprotect "Password"
'My Code starts here
'My Code ends here
Sheet1.Protect "Password"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
wSht.EnableSelection = xlUnlockedCells
End Sub
Bookmarks