• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code for Excel 2016 to create a text box pop-up with specific words

Excel Burnout

New Member
Hello!

I will put it out there that my VBA skills are nada. So I apologize if this is a basic question, as I have looked at different YouTube videos and the examples they provided did not work when trying to write the code.

I need a VBA code for when the following words are entered into sheet 1, cells D11 and D13: New York, Kansas, and Ohio. I need 3 separate text pop-up as each state has it's on specific instructions.

Thank you and I really appreciate your time in assisting me. :)
 

Marc L

Excel Ninja
Hi !​
A reminder of what is written before to log in :​
« When starting a new thread, to receive a quicker and more targeted answer, Please include a sample file in the initial post. »​
Of course with a crystal clear complete, concise & precise explanation of the need …​
 

vletm

Excel Ninja
Excel Burnout
You asked cells D11 and D13 ... hmm?
Could it be cells D11 or D13?
Copy next Sample to Sheet1's code-page.
Modify MsgBox as needed for Your 'Specific Instructions'.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Select Case Target.Address
        Case "$D$11", "$D$13"
            msg = Empty
            Select Case Target.Value
                Case "New York"
                    msg = Target.Value
                Case "Kansas"
                    msg = Target.Value
                Case "Ohio"
                    msg = "Ohio"
            End Select
            If msg <> Empty Then MsgBox "Specific Instructions", vbCritical, msg
    End Select
End Sub
 
Top