Joseph B
Joseph B

Reputation: 1

What's wrong with this BeforeSave VB?

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Cells(11, 5) = "" Then MsgBox "Cell K5 Required.", vbInformation, "Action Required" Cancel = True End If

End Sub

Private Sub Workbook_Open()

End Sub

New to VB. Watched a few videos that show this was the correct way to do what I want. K5 cell needs to be filled out before the file can be saved. Now, it doesn't matter if there is data in cell K5 or not - It wont let you save and keeps giving me the custom message.

Tried playing around with "<>" instead of "=" and added a space between the ""'s.

Upvotes: 0

Views: 13

Answers (0)

Related Questions