Excel/Unprotecting dynamic rows in a protected worksheet
Need your help in doing the below task using Formula/Macro.
I would like to unprotect the dynamic rows where it contains the word "Production Plan (Units) - Revised" in column B.
As per this example I would like to unprotect the cells C7:H7, C10:H10, C15:H15. I want to unprotect the whole row after the cell contains particular text (i.e. "Production Plan (Units) - Revised" in this case).
Please note that range will be dynamic. Please let me know if you have any question.
something like this should do it -
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
If Target.Text = "Production Plan (Units) - Revised" Then
Range("C" & Target.Row & ":H" & Target.Row).Locked = False
Range("C" & Target.Row & ":H" & Target.Row).Locked = True
I've assumed you want to exactly match production plan (units) - revised so I've done an exact match test.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here