Home Create a VBA Message Box Based on Cell Value
Reply: 0

Create a VBA Message Box Based on Cell Value

user1073
1#
user1073 Published in July 21, 2018, 1:45 pm

So, this should be fairly easy to implement, but I am unable to get the message box to display.

Context - this is for an estimation tool - if the user enters a value for a particular cell that is less than a minimum threshold, I want bring up a message box to let them know that's not a valid entry.

The cell I am referring to is named (let's just say "TEST"). Its location is on the "UI" tab (1 of 4 tabs in the workbook) is row 47, column 17.

Here is the code I have tried so far:

Sub UI Alerts()
If Cells(47, 17) < "1000" Then
MsgBox ("Minimum Value is 1000")
Exit Sub
End If

Similarly, with the named cell

Sub UI Alerts()
If ("TEST").value < "1000" Then
MsgBox ("Minimum Value is 1000")
Exit Sub
End If

I have set this up in the VBA module that corresponds to the UI tab, so shouldn't have to reference the sheet. Any idea why the message box isn't displaying? Is it possible to automatically display a message box based on a cell value?

Thanks.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.318278 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO