MsgBox not functioning

paru

New Member
Joined
Apr 28, 2003
Messages
9
Haven't played in VBA forever, so I need a little help please.

Workbook Tab Name is "collateral"
My target cell is "I36"
This cell also has a defined name of "Coll_Value"
When the user tabs in to cell I36 on this sheet, I want a message box to popup.
I have the MSG Box seperate, defined as "MsgBox_Flood"

The code I am using is shown below. When I click in to cell I36, the box does not appear as expected:

Sub MsgBox_Flood2()
'Avtivate the cell warning / reminder to complete a flood determination prior to closing the loan

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Sheets("Collateral "), Range("I36")) Is Nothing Then
Call MsgBox_Flood
End If
End If
End Sub

An option for this is to simplfy it by having the MsgBox launch if the value in I36 is greater than 1. I tried that, too, and it's still not working so I am missing something obvious.

TIA for guidance.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
The 3 things that stand out.

1:- Using Selection.Count instead of Target.Count (could be preventing the code from reaching the 'Call' line).
2:- Calling MsgBox_Flood but your procedure is named MsgBox_Flood2 (should cause an error, but only if the code reaches the 'Call' line as noted above).
3:- MsgBox_Flood2 is an empty procedure (nothing to do).

If you post more code, please use the VBA tags to separate the code from the rest of your post.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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