PDA

View Full Version : Keep Validation Input Message on screen when first open workbook (12-20-09)



stevespauldi
12-20-2009, 07:11 AM
I have a workbook with multiple worksheets and multiple vba modules.
When I first open the workbook, I want to use the validation input message for the opening active cell as a user instruction (i.e. exactly what to do first).

The problem is that when I first open the workbook the validation input message is visible for a second or two, but then disappears. If I then manually ‘reselect’ that cell, the validation input message does reappear.

How can I keep the validation input message visible on the screen when I first open the workbook??

I am using subroutine Events (e.g. Workbook_Open, Worksheet_Activate, Worksheet_Change, Worksheet_SelectionChange); I am using commands (i.e. Application.DisplayAlerts = Yes/No, Application.Enable Events = True/False); and I am using Protection with a password. I can send code if necessary.

Thanks very much for any help or suggestions.
Steve

lucas
12-20-2009, 11:20 AM
You could do this a couple of ways that I see using vba. One way would be to use a workbook open event to select the cell with validation when the workbook opens:

Put this in the thisworkbook module:
Private Sub Workbook_Open()
Sheets("Sheet1").Range("D4").Select
End Sub
Where D4 on Sheet 1 is the cell with validation.
See attached for example

lucas
12-20-2009, 11:29 AM
Or you could use a simple userform that pops up when the workbook opens with instructions. It could even be on a timer to close after so many seconds.
Put this in the workbook open module:
Private Sub Workbook_Open()
UserForm1.Show
End Sub


put this in the code module for the userform:
Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:00:05"), "KillForm"
End Sub

and put this in a standard module:
Sub KillForm()
Unload UserForm1
End Sub

See attached.