Pop up verification when opening a sheet.

  • Thread starter Thread starter neil40
  • Start date Start date
N

neil40

Hi,

I have a Workbook with several sheets on it, and I want to have a pop
up reminder so that people who work on it are asked if they are using
the correct sheet.

I basically want it to say "Are you sure you want to Enter data on
<sheetname>?" with just an OK box
How can I do this please?
If this is some sort of code/macro etc, what would happen when the
sheet first opens (IE to the last place the sheet was saved) I really
need to remind people every time they change sheet including when they
open the workbook.

Thanks for any advice

Neil
 
I do not know if my message is posting in the right place. In any event,
I would like to thank JE McGimpseyl for the link. I could not follow the
VBA codes but the link was what I needed a step-by-step guide. At least
it was fun, to sya the least.
 
One way:

Put this in your ThisWorkbook code module:

Private Sub Workbook_Open()
Const csMsg As String = _
"Are you sure you want to Enter data on " & _
vbNewLine & vbNewLine & " "
MsgBox csMsg & ActiveSheet.Name & " ?"
End Sub

Seehttp://www.mvps.org/dmcritchie/excel/getstarted.htmfor more on
macros.







- Show quoted text -

Many thanks for the reply - not sure if I explained well enough, but I
want the pop up to appear every time you click another sheet, and not
just when you open the Workbook - which this seems to do.
The reason is that we've had people enter data on incorrect sheets and
this will be a visible reminder to them to select the correct sheet
before entering data.

Thanks
Neil.
 
So change the code in the ThisWorkbook module to

Private Sub Workbook_Open()
CheckCorrectSheet
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
CheckCorrectSheet
End Sub

Private Sub CheckCorrectSheet()
Const csMsg As String = _
"Are you sure you want to Enter data on " & _
vbNewLine & vbNewLine & " "
MsgBox csMsg & ActiveSheet.Name & " ?"
End Sub
 
So change the code in the ThisWorkbook module to

Private Sub Workbook_Open()
CheckCorrectSheet
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
CheckCorrectSheet
End Sub

Private Sub CheckCorrectSheet()
Const csMsg As String = _
"Are you sure you want to Enter data on " & _
vbNewLine & vbNewLine & " "
MsgBox csMsg & ActiveSheet.Name & " ?"
End Sub



- Show quoted text -

Cheers J E - don't know what your name is!
 
Back
Top