Macro help: Adding Message Box if Cell = certain value

Jessica1979

New Member
Joined
Oct 16, 2013
Messages
3
Hi, I'm a newbie to macro, and am stuck...help!

The worksheet needs to automatically pops up a warning message whenever range of cells K12 to K27 equals to 815500. I got it to partially work with the code:
______________________________________
Private Sub Worksheet_Change(ByVal Target As Range)

If Range("K12").Value = 815500 Then

MsgBox ("GL Account #815500 - Training & Education: requires CEU form approved by HR and must be included for reimbursement " & ". Continue?"), vbYesNo

End If
End Sub
_____________________________________

Issue 1) macro only applies to cell K12, how do I apply to range of cells K12 to K27?

Issue 2) macro now run all the time when K12 = 815500, how do I get it to only display the message box once and stop (until the next cell = 815500 between cell range K12 to K27)?

Help...my hair's going to turn white from thinking so much...:(
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
What do you want to happen if the answer to the popup is Yes, and what should happen if it is No?
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,824
Members
449,050
Latest member
Bradel

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