Pop Up Box

tpotmatt

New Member
Joined
Apr 25, 2012
Messages
22
I am trying to have a pop up box for multiple cells. This is the code I am currently using.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim Rng1            As Range

    Set rng = Range("A1:B10")
    If Intersect(Target, rng) Is Nothing Then Exit Sub
    MsgBox "Hi, you have select cell " & Target.Address & vbCrLf & "Please input a number", vbInformation
    

End Sub

It works great for 1 cell, but not exactly what I need. Is it possible to have a pop up box for multiple cells in the same worksheet? Any help will be greatly appreciated.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try something like this...

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] Worksheet_SelectionChange([color=darkblue]ByVal[/color] Target [color=darkblue]As[/color] Range)
    
    [color=darkblue]If[/color] [color=darkblue]Not[/color] Intersect(Target, Range("A1:B10")) [color=darkblue]Is[/color] [color=darkblue]Nothing[/color] [color=darkblue]Then[/color]
        MsgBox "Hi, you have select cell " & Intersect(Target, Range("A1:B10")).Address & _
                vbCrLf & "Please input a number", vbInformation
    [color=darkblue]End[/color] [color=darkblue]If[/color]
    
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Upvote 0

Forum statistics

Threads
1,203,068
Messages
6,053,343
Members
444,654
Latest member
Rich Cohen

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