I'm appologize if this topic has been covered...I just couldn't find the right one that would work.
I have an excel, where Column D is a value used in a look up for column E,F,G, and R.
So when I put in 12345 it will automatically fill in the lookup values and fill in the E,F,G, and R. (duh, I know)
One value for D is "MISC".
When I put this one in, the values for E,F,G, and R are blank as I have to put those in manually.
So in order to keep my excel from being edited or [formulas] seen, I protected the sheet.
And for this, I wanted a VBA that would allow me to UNLOCK cells E,F,G, and R when the value of D is "MISC".
*Keep in mind cells E,F,G, and R all have a lookup formula in them as they connect with D's value.
For testing purposes, I just tried only column F and R as it seems the VBA function of RANGE only allows Cell1 and Cell2 so my fomula is my Sheet Code is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.Unprotect ""
If Not Intersect(Target, Range("D3:D100")) = "MISC" Then
Range(Cells(Target.Row, "F"), Cells(Target.Row, "R")).Locked = False
End If
Me.Protect ""
End Sub
I have no clue how to do this as I believe it unlocks that whole row...even the G column that wasn't in the VBA.
Moreover, I get some error code when I fill in values for random cells [on that line] stating some ERROR CODE 91.
I would appreciate any help...
I have an excel, where Column D is a value used in a look up for column E,F,G, and R.
So when I put in 12345 it will automatically fill in the lookup values and fill in the E,F,G, and R. (duh, I know)
One value for D is "MISC".
When I put this one in, the values for E,F,G, and R are blank as I have to put those in manually.
So in order to keep my excel from being edited or [formulas] seen, I protected the sheet.
And for this, I wanted a VBA that would allow me to UNLOCK cells E,F,G, and R when the value of D is "MISC".
*Keep in mind cells E,F,G, and R all have a lookup formula in them as they connect with D's value.
For testing purposes, I just tried only column F and R as it seems the VBA function of RANGE only allows Cell1 and Cell2 so my fomula is my Sheet Code is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.Unprotect ""
If Not Intersect(Target, Range("D3:D100")) = "MISC" Then
Range(Cells(Target.Row, "F"), Cells(Target.Row, "R")).Locked = False
End If
Me.Protect ""
End Sub
I have no clue how to do this as I believe it unlocks that whole row...even the G column that wasn't in the VBA.
Moreover, I get some error code when I fill in values for random cells [on that line] stating some ERROR CODE 91.
I would appreciate any help...