Share via

VBA Message Box Syntax Error

Anonymous
2019-11-26T16:54:20+00:00

Looking for advise on why I keep getting "Syntax Error" on code below?

I am trying to get pop up message when the cell = "PM_Protection" only.

Thanks for any help you can offer.

Private Sub WorkSheet_Change1 (ByVal Target As Range)

If Target.Column 2 And Target.Value = "PM_Protection" Then

MsgBox "Extended Warranty Options are not available to PM_Protection: " & Target, vbInformation, "QMC Administrator Message 8"

End If

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-11-26T16:58:13+00:00

Hello

I am V. Arya, Independent Advisor, to work with you on this issue. Use below code

Private Sub WorkSheet_Change(ByVal Target As Range)

If Target.Column = 2 And Target.Value = "PM_Protection" Then

MsgBox "Extended Warranty Options are not available to PM_Protection: " & Target, vbInformation, "QMC Administrator Message 8"

End If

End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2019-11-26T17:16:48+00:00

    Hello

    I am V. Arya, Independent Advisor, to work with you on this issue. Use below code

    Private Sub WorkSheet_Change(ByVal Target As Range)
    
    If Target.Column = 2 And Target.Value = "PM_Protection" Then
    
    MsgBox "Extended Warranty Options are not available to PM_Protection: " & Target, vbInformation, "QMC Administrator Message 8"
    
    End If
    
    End Sub
    

    V. Arya, solved my problem and saved my day thank you.

    Was this answer helpful?

    0 comments No comments