Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
I have a worksheet called "Data". Anytime a user selects an entire
row I would like for a warning to appear that says "If you insert, delete, or copy and insert rows in the top section, you must make the same changes in the bottom section." Then, I want the user to be able to click OK on the warning and proceed with whatever changes they decide to make. The problem I have is how to keep the warning from appearing again immediately when, for example, the user proceeds to insert a row. Is there a timer I could use so the warning would not occur again for some number of minutes? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
On 14/02/2012 8:26 AM, JG Scott wrote:
I have a worksheet called "Data". Anytime a user selects an entire row I would like for a warning to appear that says "If you insert, delete, or copy and insert rows in the top section, you must make the same changes in the bottom section." Then, I want the user to be able to click OK on the warning and proceed with whatever changes they decide to make. The problem I have is how to keep the warning from appearing again immediately when, for example, the user proceeds to insert a row. Is there a timer I could use so the warning would not occur again for some number of minutes? Hi JG Sub myWarning() Dim WarnMess as integer WarnMess = ("Danger Will Robinson, you are about to do something monumentally Stupid! Are you sure you want to continue...", vbYesNo) If WarnMess = vbNo then Cancel = True Else 'Do your thing here End If End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
Pick a cell on the worksheet to store a date & time. I will use cell
T1 to illustrate and assume the user will not try inserting a new row 1. Add the following to the worksheet's code window: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row 1 And Now - Range("T1") 1 / 24 / 60 Then MsgBox ("Your warning.") Range("T1") = Now() End If End Sub It will not warn again if a warning was given within the last minute. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
JG Scott explained :
I have a worksheet called "Data". Anytime a user selects an entire row I would like for a warning to appear that says "If you insert, delete, or copy and insert rows in the top section, you must make the same changes in the bottom section." Then, I want the user to be able to click OK on the warning and proceed with whatever changes they decide to make. The problem I have is how to keep the warning from appearing again immediately when, for example, the user proceeds to insert a row. Is there a timer I could use so the warning would not occur again for some number of minutes? I suggest protecting the sheet and adding a menu or button that appropriately automates the row insertion in both places. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
Could be done if you can ensure that users would be selecting entire
rows. That entirerow selection event can be trapped and a timer set to allow entire rows to be selected and inserted for any period of time you want before events are re-enabled and the warning re-triggered But some events, like inserting a row via the insert row Icon or right-clickinsertentire row or ctrl + shift++ are not trappable events. How would you deal with those? How would you deal with the user who inserted the rows anyway but did not insert them in the bottom section? I think it may be easier to train your users. Gord On Mon, 13 Feb 2012 13:26:43 -0800 (PST), JG Scott wrote: I have a worksheet called "Data". Anytime a user selects an entire row I would like for a warning to appear that says "If you insert, delete, or copy and insert rows in the top section, you must make the same changes in the bottom section." Then, I want the user to be able to click OK on the warning and proceed with whatever changes they decide to make. The problem I have is how to keep the warning from appearing again immediately when, for example, the user proceeds to insert a row. Is there a timer I could use so the warning would not occur again for some number of minutes? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need warning message before a user changes worksheet
Gord Dibben was thinking very hard :
I think it may be easier to train your users. But, Gord, you KNOW it would be better lock users out of messing with the sheet structure AND automate the various processes! ...Right?<bg -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to get rid of the warning message | Setting up and Configuration of Excel | |||
Message Box Warning | Excel Programming | |||
using VBA how can I delete a worksheet w/o the warning message pop | Excel Discussion (Misc queries) | |||
Warning Message | Excel Worksheet Functions | |||
How do I input a warning message to remind the user to enter into. | Excel Discussion (Misc queries) |