Need pop up from drop down menu - can't figure out how to fix my code

synthesis45

New Member
Joined
Jul 28, 2010
Messages
4
I can't seem to figure out the exact need for my excel sheet. I have a sheet that has drop down menus in B5:AF25. There are many choices, but I'd like a pop up to trigger only if the selection made is either - special project or meeting. I want the pop up to say - please enter a comment by right clicking on this cell. I have this written so far, but I can't seem to figure out how to tell it all columns or my range of columns rather than just column B. I also am not sure how to add the second target value. Any assistance would be greatly appreciated. Thank you!


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("B")) Is Nothing Then If Target.Value = "Special Project" Then MsgBox "needs comment right click cell", vbExclamation
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
6,515
Office Version
  1. 2019
Platform
  1. Windows
Hi
try

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Me.Range("B5:AF25")) Is Nothing Then
        If Not IsError(Application.Match(Target.Value, Array("Special Project", "meeting"))) Then
            MsgBox "needs comment right click cell", vbExclamation, "Comment Required"
        End If
    End If
End Sub

Dave
 

Watch MrExcel Video

Forum statistics

Threads
1,129,714
Messages
5,637,940
Members
416,993
Latest member
ant8989

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top