Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I created a form (to be used like a template) in Excel
(saved as xls. not xlt.) In order to ensure that the form is filled out in it's entirety, I wrote a code in VBA (using BeforeSave) that will not allow the file to be saved if certain cells are blank. Unfortunately though, I am now unable to save my file for others to use...since these cells are blank. They need to be blank when the file is open, so that others can fill them in. Any suggestions would be greatly appreciated. Please help. Thank You. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use a toolbar button to turn events on and off. In the off position the
event is disabled and you can do what you want. The code also changes the caption of the button to let me know where I stand. [watch word wrap] Private Sub EnableAllEvents() Select Case Application.EnableEvents Case False Application.EnableEvents = True Application.CommandBars("SB2").Controls(3).Caption = "Disable Events" Case True Application.EnableEvents = False Application.CommandBars("SB2").Controls(3).Caption = "Enable Events" End Select Application.ScreenUpdating = True End Sub -- sb "HRobertson" wrote in message ... I created a form (to be used like a template) in Excel (saved as xls. not xlt.) In order to ensure that the form is filled out in it's entirety, I wrote a code in VBA (using BeforeSave) that will not allow the file to be saved if certain cells are blank. Unfortunately though, I am now unable to save my file for others to use...since these cells are blank. They need to be blank when the file is open, so that others can fill them in. Any suggestions would be greatly appreciated. Please help. Thank You. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
H,
Wrap your code in something like this: If Application.UserName < "Bernie Deitrick" Then MsgBox "I'm running the code" 'Code here Else MsgBox "I'm not running the code because you're the guy in charge." End If Of course, change the "Bernie Deitrick" to whatever Application.UserName returns for you. HTH, Bernie MS Excel MVP "HRobertson" wrote in message ... I created a form (to be used like a template) in Excel (saved as xls. not xlt.) In order to ensure that the form is filled out in it's entirety, I wrote a code in VBA (using BeforeSave) that will not allow the file to be saved if certain cells are blank. Unfortunately though, I am now unable to save my file for others to use...since these cells are blank. They need to be blank when the file is open, so that others can fill them in. Any suggestions would be greatly appreciated. Please help. Thank You. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event (BeforeSave) - How to test VBA code? Dave P. can you hear me now? | Excel Discussion (Misc queries) | |||
BeforeSave event | Excel Discussion (Misc queries) |