Golfpro1286
New Member
- Joined
- Aug 22, 2018
- Messages
- 30
Hello, I have the following VBA code in a sheet that is giving me trouble when the sheet is protected: The original thread for this VBA and its purpose can be found at the bottom of this post.
The VBA works great, however it stops working when the sheet is protected. I protect the sheet so people can more easily tab between the fields that need to be filled in.
When protecting it I allow the following permissions:
Select Unlocked Cells
Format Cells
Format Columns
Format Rows
Edit Objects
Edit Scenarios
I have tried allowing all permissions and it still won't work while protected.
Cell B225 is locked so people cannot accidentally overwrite the formula.
Any help would be great. Thanks!
Original thread: https://www.mrexcel.com/forum/excel-questions/1104696-vba-message-box-help-2.html
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KyCell As Range
If Target.CountLarge > 1 Then Exit Sub
Set KyCell = Range("B225")
On Error Resume Next
Set KyCell = Union(KyCell, KyCell.Precedents)
On Error GoTo 0
If Not Intersect(Target, KyCell) Is Nothing Then
If Me.CheckBox133.Value = True And Range("B225").Value >= 75000 Then
MsgBox "Alert: This loan is for business purpose and exceeds $75M. A loan memo is required for the file."
Sheets("Commercial Loan Memo").Visible = True
End If
End If
End Sub
When protecting it I allow the following permissions:
Select Unlocked Cells
Format Cells
Format Columns
Format Rows
Edit Objects
Edit Scenarios
I have tried allowing all permissions and it still won't work while protected.
Cell B225 is locked so people cannot accidentally overwrite the formula.
Any help would be great. Thanks!
Original thread: https://www.mrexcel.com/forum/excel-questions/1104696-vba-message-box-help-2.html
Last edited: