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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
13,542
Office Version
  1. 365
Platform
  1. Windows
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.
 

Forum statistics

Threads
1,141,402
Messages
5,706,245
Members
421,433
Latest member
yash0468

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