Macro for cell showing exact value

V

vijay

Hi,

Can anyone help me on this.
I want a message box poping up with message saying as "Do you want to close
the Batch" whenever there is value 50 in the cell "D2"

Please do help me with a macro on the same

vijay

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...cc64ba6&dg=microsoft.public.excel.programming
 
K

Ken

vijay

Put this code in the worksheet object:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("d2").Value = 50 Then MsgBox "Dow you want to close the
Batch?"

End Sub


I suspect you will want to do more eventually, but, this should
accomplish what you have asked so far.

Good luck


Ken
Norfolk, Va
 
O

Otto Moehrbach

A slight mod to provide a Yes/No. Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("d2").Value = 50 Then _
MsgBox "Do you want to close the Batch?", 4, "Close?"
End Sub
vijay

Put this code in the worksheet object:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("d2").Value = 50 Then MsgBox "Dow you want to close the
Batch?"

End Sub


I suspect you will want to do more eventually, but, this should
accomplish what you have asked so far.

Good luck


Ken
Norfolk, Va
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top