Home |
Search |
Today's Posts |
#17
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
After you type that "application.enableevents = false" into the immediate
window, are you hitting enter? This command tells excel to stop looking for events completely. So it should work for you. (I've never seen it fail.) If the next test fails, enter this command right after the first: ?application.enableevents That should return True or False. If you see true, then events are enabled and your SaveAs will fire that event. If you see false (I hope!), then events are disabled and you should be able to do the SaveAs. Pam M wrote: I did--still no luck. Here is what I am doing. Clicking View - Immediate Window Entering Application.EnableEvents = False into the immediate window Back to Excel, clicking File-Save As, but can't because I get the pop up to force entry into the cell. "Dave Peterson" wrote: Try the instructions about disabling events once more. Pam M wrote: Gord--I followed these instructions to save the workbook template but still get the message that the cells need to be filled out. I cannot even click Save-As--the message pops up immediately. Any thoughts? "Gord Dibben" wrote: You will have to save the workbook as a Template with the beforesave code and the required cells empty. To do this, add the code to Thisworkbook.........I think you already did that. Leave the required cells empty then save the workbook with events disabled. Application.EnableEvents = False entered into the Immediate Window will do that for you. Save the workbook as a FileType of Template(*.xlt) Now close the workbook. You will not be asked to fill in the cells Go back to the Immediate window and re-enable events by making them = True. From now on when users open a new workbook based upon the Template, they will have to fill in the cells before saving. Gord Dibben MS Excel MVP On Thu, 8 Jan 2009 07:04:47 -0800, mdtuckett wrote: Hi Julie, I have added your code to my spreadsheet and it does force the user to populate the required cells. However, I need the cells to be blank when other users open the spreadsheet and for them to be forced to populate the cells before they save a copy. Do you know how I can save the spreadsheet having added the code, without populating the fields myself? Thanks "JulieD" wrote: Hi Rob from the menu in the VBE screen choose view / project explorer Cheers JulieD "abfabrob" wrote in message ... It doesn't say "This Workbook" anywhere... the VBE screen is completely blank... Rob. "JulieD" wrote: Hi Rob to use the code, right mouse click on a sheet tab and choose view / code - in the VBE window you'll see down the left hand side your workbook's name in bold & brackets ... under that will be things like sheet1,sheet2, ThisWorkbook - the code needs to go into the "ThisWorkbook" section - so double click on ThisWorkbook then on the top right side of the screen you have two drop down arrows - on the one of the left choose Workbook on the one on the right choose Before Save then Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) End Sub will appear on your screen - the first line (starting with Private & ending with Cancel As Boolean is all one line like in your screen) now between these two lines you need to copy & paste the code Dim cell As Range For Each cell In Sheets("Sheet2").Range("A1,A2,A3,A4") If IsEmpty(cell.Value) Then MsgBox "You must fill in cell " & cell.Address Application.Goto cell Cancel = True Exit For End If Next cell --- now where it says "Sheet2" above change that to the sheet name you want to check for entry on (leave the "") and where it says A1, A2, A3, A4 change these to the actual cells you want to ensure have data in them. once you've done that use ALT & F11 to switch back to your workbook and test it. Let us know how you go. Cheers JulieD "abfabrob" wrote in message ... I was given this code: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As BooleaÂÂ*n, _ Cancel As Boolean) Dim cell As Range For Each cell In Range("Required_Cells") If IsEmpty(cell.Value) Then MsgBox "You must fill in cell " & cell.AddreÂÂ*ss Application.Goto cell Cancel = True Exit For End If Next cell End Sub But I have no idea what it means. I put it in the right place (I think) and I input the cells I want the users to fill in, butI keep getting this message: "Compile error: user-defined type not defined". I so have no knowledge of anything, quite clearly. I need it explained step by step. Cheers, Rob "JulieD" wrote: Hi following on from your discussion with Jason Morin (please stay in the original thread) - what is the code you're getting the errors on, what is the sheet name and cells that you want to make mandatory? Cheers JulieD "abfabrob" wrote in message ... I am creating an application form where I want users to fill certain cells in before closing the document. Does anyone have an idiots guide to doing this, cos I'm not great with excell. ANY help welcome!!! -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Making cells compulsary to fill in on a worksheet | Excel Discussion (Misc queries) | |||
Change a cell's fill color dynamically? | Excel Discussion (Misc queries) | |||
How to create mandatory cells in a worksheet | Excel Worksheet Functions | |||
Excel - formula to calculate colored fill cells within a range wi. | Excel Worksheet Functions | |||
making cells adjust | Excel Discussion (Misc queries) |