Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to know how to create a pop-up message when a worksheet is opened. I
need it to say "PUT IN REQ # AND DATE NEEDED NOW". I already have the following VBA Code to add the current date: ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" What code and where does it go to add the pop-up box? I would appreciate any help possible. Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This needs to go on the ThisWorkbook sheet. Also of caution, does the
workbook only have one sheet? If not, you might want to include the line "Sheets("SheetIwant").select" near the beginning. Private Sub Workbook_Open() msgbox "PUT IN REQ # AND DATE NEEDED NOW" ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" End sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "patsy" wrote: I need to know how to create a pop-up message when a worksheet is opened. I need it to say "PUT IN REQ # AND DATE NEEDED NOW". I already have the following VBA Code to add the current date: ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" What code and where does it go to add the pop-up box? I would appreciate any help possible. Thanks. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You cannot "open" a worksheet.
Do you mean "activate" or "select" a worksheet? Right-click on the sheet tab and "View Code" Paste this into that module. Note: no error-checking included. Private Sub Worksheet_Activate() reqno = InputBox("Enter a Requisition Number") ActiveSheet.Unprotect Password:="password" Range("T10") = Now() Range("U10") = reqno ActiveSheet.Protect Password:="password" End Sub Gord Dibben MS Excel MVP On Mon, 12 Jan 2009 11:51:01 -0800, patsy wrote: I need to know how to create a pop-up message when a worksheet is opened. I need it to say "PUT IN REQ # AND DATE NEEDED NOW". I already have the following VBA Code to add the current date: ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" What code and where does it go to add the pop-up box? I would appreciate any help possible. Thanks. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That didn't work. This is a workbook with several tabs. Each sheet in the
workbook is password protected. The guy who opens this workbook has to put a requisition # and the date that he needs the order on the req. He always forgets to enter into these fields. I want to make this idiot proof for him so that when he opens the workbook and goes to the worksheet that needs this information, the pop-up box will tell him that he needs to put this information in. When I added the code to that particular worksheet, a box came up telling me that there were macros. I don't have any macros in the workbook and don't understand why this box comes up. Hope I explained this correctly. Thanks "Luke M" wrote: This needs to go on the ThisWorkbook sheet. Also of caution, does the workbook only have one sheet? If not, you might want to include the line "Sheets("SheetIwant").select" near the beginning. Private Sub Workbook_Open() msgbox "PUT IN REQ # AND DATE NEEDED NOW" ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" End sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "patsy" wrote: I need to know how to create a pop-up message when a worksheet is opened. I need it to say "PUT IN REQ # AND DATE NEEDED NOW". I already have the following VBA Code to add the current date: ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" What code and where does it go to add the pop-up box? I would appreciate any help possible. Thanks. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Any VBA code is treated by Excel warning as a "macro".
If you have worksheet code like the SheetActivate code I posted, that will raise the warning. If you have an empty genral module, that will raise a warning also even there is no code. Gord On Mon, 12 Jan 2009 13:37:00 -0800, patsy wrote: That didn't work. This is a workbook with several tabs. Each sheet in the workbook is password protected. The guy who opens this workbook has to put a requisition # and the date that he needs the order on the req. He always forgets to enter into these fields. I want to make this idiot proof for him so that when he opens the workbook and goes to the worksheet that needs this information, the pop-up box will tell him that he needs to put this information in. When I added the code to that particular worksheet, a box came up telling me that there were macros. I don't have any macros in the workbook and don't understand why this box comes up. Hope I explained this correctly. Thanks "Luke M" wrote: This needs to go on the ThisWorkbook sheet. Also of caution, does the workbook only have one sheet? If not, you might want to include the line "Sheets("SheetIwant").select" near the beginning. Private Sub Workbook_Open() msgbox "PUT IN REQ # AND DATE NEEDED NOW" ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" End sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "patsy" wrote: I need to know how to create a pop-up message when a worksheet is opened. I need it to say "PUT IN REQ # AND DATE NEEDED NOW". I already have the following VBA Code to add the current date: ActiveSheet.Unprotect Range("T10") = Now() ActiveSheet.Protect ActiveSheet.Unprotect Password:="password" Range("T10") = Now() ActiveSheet.Protect Password:="password" What code and where does it go to add the pop-up box? I would appreciate any help possible. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatic update of spreadsheet & automatic update between workboo | Excel Worksheet Functions | |||
Automatic links message when opening a workbook | Excel Discussion (Misc queries) | |||
#N/A Message | Excel Discussion (Misc queries) | |||
Automatic message | Excel Discussion (Misc queries) | |||
changing the message in an error message | Excel Worksheet Functions |