ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   I need help on a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/51367-i-need-help-macro.html)

[email protected]

I need help on a Macro
 
hi guys
i really need to know how if i enter into cell F12 35 how can i get a
message box to appear with say "You need to restock" written on it and
the to buttons Yes and No?
Can anybody help me????????????????????????


Bob Phillips

I need help on a Macro
 
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$F$12" And Target.Value = 35 Then
MsgBox "You need to restock", vbYesNo
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
hi guys
i really need to know how if i enter into cell F12 35 how can i get a
message box to appear with say "You need to restock" written on it and
the to buttons Yes and No?
Can anybody help me????????????????????????





All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com