Popup based on cell value

themule

New Member
Joined
Feb 8, 2015
Messages
3
Hi,
I am trying to create a popup based on certain cells changing their value from the default value. Say I have 10 cells from A1 and the def value is Select an Option (drop list). I want to have a MsgBox popping up if any of the cells from A1 through A10 is changed from "Select an Option" to anything else.
What I did is the following only for the first cell:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").value <> "Select an Option" Then
MsgBox "These services are rendered in design phase only. Be sure to check the corresponding services in the Construction Tab and select as applicable", vbExclamation, "Additional Services"
End If
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Maybe like this
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
        If Target.Value <> "Select an Option" Then
            MsgBox "These services are rendered in design phase only. Be sure to check the corresponding services in the Construction Tab and select as applicable", vbExclamation, "Additional Services"
        End If
    End If
End Sub
 
Upvote 0
Maybe like this
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
        If Target.Value <> "Select an Option" Then
            MsgBox "These services are rendered in design phase only.", vbExclamation, "Select"
        End If
    End If
End Sub


Thanks for replying, but no it's giving a runtime error Type Mismatch as soon as I click on Any of A1 to A10. I think there is another way to define a range of cells with referring to each cell independently.
Also I have a default value not Nothing.

Thanks!!
 
Upvote 0
What line is highlighted when it brings up the type-mismatch error?

In any case, I ran this slightly modified code and it works as ecpecyed, see if it works like you
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
        If Target.Value <> "Select an Option" Then
            MsgBox "These services are rendered in design phase only. Be sure to check the corresponding services in the Construction Tab and select as applicable", vbExclamation, "Additional Services"
        End If
    End If
End Sub
 
Upvote 0
Thank you Momentman, this actually works!
The mismatch error was on the cell range itself, I guess with selection change, it did not like it.

Thank you very much!!
 
Upvote 0

Forum statistics

Threads
1,216,057
Messages
6,128,520
Members
449,456
Latest member
SammMcCandless

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
Back
Top