Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I write code for the following situation. Say I have a workbook
with two sheets. Whenever any data hits cell A10 in Sheet2, I would like a MsgBox to pop up in Sheet1 saying Stop! Thanks for any suggestions. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let's assume that hits means any data is entered into.
In Sheet2's worksheet code enter: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Cells(10, "A")) Is Nothing Then Else Worksheets("Sheet1").Activate MsgBox ("STOP") End If End Sub -- Gary''s Student "TimN" wrote: How would I write code for the following situation. Say I have a workbook with two sheets. Whenever any data hits cell A10 in Sheet2, I would like a MsgBox to pop up in Sheet1 saying Stop! Thanks for any suggestions. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That did it thanks!
One last thing, I would like the spreadsheet to close when the user clicks OK in the nessage box without saving and without getting the "Would you like to save changes?" message. Can I do that? "Gary''s Student" wrote: Let's assume that hits means any data is entered into. In Sheet2's worksheet code enter: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Cells(10, "A")) Is Nothing Then Else Worksheets("Sheet1").Activate MsgBox ("STOP") End If End Sub -- Gary''s Student "TimN" wrote: How would I write code for the following situation. Say I have a workbook with two sheets. Whenever any data hits cell A10 in Sheet2, I would like a MsgBox to pop up in Sheet1 saying Stop! Thanks for any suggestions. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are very welcome. To quit without the additional question:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Cells(10, "A")) Is Nothing Then Else Worksheets("Sheet1").Activate MsgBox ("STOP") Application.DisplayAlerts = False Application.Quit End If End Sub -- Gary''s Student "TimN" wrote: That did it thanks! One last thing, I would like the spreadsheet to close when the user clicks OK in the nessage box without saving and without getting the "Would you like to save changes?" message. Can I do that? "Gary''s Student" wrote: Let's assume that hits means any data is entered into. In Sheet2's worksheet code enter: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Cells(10, "A")) Is Nothing Then Else Worksheets("Sheet1").Activate MsgBox ("STOP") End If End Sub -- Gary''s Student "TimN" wrote: How would I write code for the following situation. Say I have a workbook with two sheets. Whenever any data hits cell A10 in Sheet2, I would like a MsgBox to pop up in Sheet1 saying Stop! Thanks for any suggestions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Msgbox Code Help Please.... | Excel Discussion (Misc queries) | |||
VBA code using if then and msgbox | Excel Discussion (Misc queries) | |||
Problem with Msgbox Code | Excel Programming | |||
syntax for code in MsgBox()? | Excel Programming | |||
MsgBox Code Error | Excel Programming |