I've a small problem, I know how to automate a Macro but I'm not getting how to do this .
My problem: I have an excel sheet with data from row 8 to end and columns A to AZ. Now in the excel sheet I want to run a macro automatically when the user changes the yellow colored cell it's column is fixed ("N") but row is not fixed as the user can insert rows if they want. how can I do it.
This is the macro I wrote:
Sub Row_Locker()
Dim locat As String
Dim colstart As String
Dim colend As String
Dim topath As String
ActiveSheet.Protect Password:="mbt"
ActiveSheet.Unprotect
rlocat = ActiveCell.Row
clocat = ActiveCell.Column
colstart = "N"
colend = InputBox("enter the end column name")
topath = colstart & "8" & ":" & colend & rlocat
Cells.Select
' unlock all the cells
Selection.Locked = False
' next, select the cells (or range) that you want to make read only,
' here I used simply A1
Range(topath).Select
' lock those cells
Selection.Locked = True
' now we need to protect the sheet to restrict access to the cells.
' I protected only the contents you can add whatever you want
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, _
Scenarios:=False, AllowInsertingRows:=True
End Sub
I want the macro to run even if any yellow colored cell value changes. how to do it. the row number is not fixed. the excel sheet looks like this: I'm referring to yellow cell at column N and row 108

Range("DataCells")- Matt