PDA

View Full Version : [SOLVED] Worksheet change help please



blackie42
10-02-2014, 06:34 AM
Hi,

I'm wanting to put a message out (MSGBOX) if column A is empty and the adjacent cell in column B is changed to Closed. To put it another way - prevent cells in Column B from being changed to Closed if the adjacent cell in Column A is empty.

Any help appreciated

thanks
jon

holycow
10-02-2014, 07:31 AM
Hi

Here is one way. It goes in the respective Sheet Module.


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 2 Then
If Target.Offset(, -1) = "" And Target = "Closed" Then
Application.Undo
MsgBox "Item can't be closed if Column A blank"
End If
End If
Application.EnableEvents = True
End Sub

blackie42
10-03-2014, 01:02 AM
Thanks for the help mate - works fine

regards
Jon