Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Required cells??

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Required cells??

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Required cells??

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula required for matching cells daviebutton New Users to Excel 2 September 24th 09 12:07 AM
is it possible to make certain cells required based on criteria Mim Excel Worksheet Functions 0 September 19th 06 04:26 PM
Can I make certain cells required? ~C Excel Worksheet Functions 12 May 2nd 06 07:42 PM
How do I set up some cells in a spreadsheet to be a required fiel. mickiemaggie Excel Worksheet Functions 1 March 1st 05 12:37 AM
Help required putting borders around cells. Centurian Excel Programming 9 February 4th 05 12:27 AM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"