Message box when cell contains specific text VBA

BadFish523

Board Regular
Joined
Feb 15, 2018
Messages
56
I'm still very new to VBA and learning. Hopefully this is a simple request. I need a VBA that when my cell K8 contains FALSE a message box will pop up. I can not seem to find the right way to trigger the message box. Can anybody help?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Also I suppose there might be another way but I'm less confident in this one. The reason my cell K8 would read FALSE is because its linked to a check box. So another way would be when the check box is unchecked the message box would appear.
 
Upvote 0
How about
Code:
Sub CboxClick()
If ActiveSheet.CheckBoxes(Application.Caller) < 0 Then MsgBox "false"
End Sub
 
Upvote 0
A little more info. I have a checkbox placed over K8 and linked to it also. When the box is checked through conditional formatting it changes K8 green and also the text in K8 to green so as to hide the word TRUE. Same thing happens when unchecked but with red text and box fill. It will be an indicator on the sheet for safety issues in the shop. The message box will be a reminder that when red is seen to make sure and notify the safety department. Thanks.
 
Upvote 0
How about
Code:
Sub CboxClick()
If ActiveSheet.CheckBoxes(Application.Caller) < 0 Then MsgBox "false"
End Sub

It's still not bringing up the message box. I tried putting it in this worksheet, and a new module neither worked.
 
Upvote 0
It needs to go in a standard module, Then right click the checkbox & assign macro, select the macro from the list.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

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