JumboCactuar
Well-known Member
- Joined
- Nov 16, 2016
- Messages
- 773
- Office Version
-
- 365
- Platform
-
- Windows
Hi,
i cant figure why this isnt working, when i change the selection "The cell your trying to change is on a protected sheet"
e30 is the linked cell to the dropdown box which has 3 options.
It works fine unprotected but i need to protect the sheet. I have tried the protect code as shown above and also inside the IF statements, no luck
any help appreciated
i cant figure why this isnt working, when i change the selection "The cell your trying to change is on a protected sheet"
Code:
Sub DataChange()
Activesheet.Unprotect "password"
If Range("e30") = 1 Then
Range("c6").FormulaR1C1 = "=IF(Pivot!RC[17]="""","""",Pivot!RC[17])"
ElseIf Range("e30") = 2 Then
Range("C6").FormulaR1C1 = "=IF(Pivot!RC[41]="""","""",Pivot!RC[41])"
ElseIf Range("e30") = 3 Then
Range("c6").FormulaR1C1 = "=IF(Pivot!RC[62]="""","""",Pivot!RC[62])"
EndIf
Activesheet.Protect "password"
End Sub
e30 is the linked cell to the dropdown box which has 3 options.
It works fine unprotected but i need to protect the sheet. I have tried the protect code as shown above and also inside the IF statements, no luck
any help appreciated