Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet that we are using as a template.
The worksheet has cells we have made in to drop downs. Can these drop downs be setup as a "Reuired"?? Can certain cells be setup that if they are not complete the sheet won't save or a error message appears? Thanks in advance, TT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What you need is a Workbook_BeforeSave event macro. You can write code into
this macro to do any checks you want and to display any messages you want. You can also write the code to cancel the Save command if certain checks are not satisfied. The cell addresses of the specific cells you want checked have to be written into the code or you have to setup a range of all those cells and name it. The following macro does what you want with a range of required cells named TheCells. This macro must be placed in the workbook module of your file. To do this, right-click on the Excel icon to the left of the word File in the menu at the top of your screen. Select View Code. Paste this macro into that module. If you wish, send me direct via email a valid email address and I will send you a small file that contains this macro properly placed. My email address is . Remove the "nop" from this address. HTH Otto "Tim T" wrote in message ... I have a worksheet that we are using as a template. The worksheet has cells we have made in to drop downs. Can these drop downs be setup as a "Reuired"?? Can certain cells be setup that if they are not complete the sheet won't save or a error message appears? Thanks in advance, TT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops. Forgot to include the macro. Otto
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim i As Range Cancel = False SaveAsUI = False For Each i In Range("TheCells") If i = "" Then MsgBox "Cell " & i.Address(0, 0) & " must be filled in." Cancel = True Exit For End If Next i End Sub "Otto Moehrbach" wrote in message ... What you need is a Workbook_BeforeSave event macro. You can write code into this macro to do any checks you want and to display any messages you want. You can also write the code to cancel the Save command if certain checks are not satisfied. The cell addresses of the specific cells you want checked have to be written into the code or you have to setup a range of all those cells and name it. The following macro does what you want with a range of required cells named TheCells. This macro must be placed in the workbook module of your file. To do this, right-click on the Excel icon to the left of the word File in the menu at the top of your screen. Select View Code. Paste this macro into that module. If you wish, send me direct via email a valid email address and I will send you a small file that contains this macro properly placed. My email address is . Remove the "nop" from this address. HTH Otto "Tim T" wrote in message ... I have a worksheet that we are using as a template. The worksheet has cells we have made in to drop downs. Can these drop downs be setup as a "Reuired"?? Can certain cells be setup that if they are not complete the sheet won't save or a error message appears? Thanks in advance, TT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula required for matching cells | New Users to Excel | |||
is it possible to make certain cells required based on criteria | Excel Worksheet Functions | |||
Can I make certain cells required? | Excel Worksheet Functions | |||
How do I set up some cells in a spreadsheet to be a required fiel. | Excel Worksheet Functions | |||
Help required putting borders around cells. | Excel Programming |