#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Mandatory Cells

I want to make a specific cell on a spread sheet I've created mandatory
before the document can be saved. For example; L2 must have a data entry
before document can be saved.

Is this possible, if so, how do I do it.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,173
Default Mandatory Cells

Doorguy

You could put some workbook_beforesave() event code in the ThisWorkbook
module, like so

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Worksheets("Sheet1").Range("L2").Value = "" Then
MsgBox "Sheet1 Cell L2 must have an entry, save aborted", vbOKOnly +
vbInformation, "Error"
Cancel = True
End If
End Sub

To implement right click the Excel icon near the top left of the window and
select view code, paste the code here, change the sheet name as necessary
and save the file

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"doorguy" wrote in message
...
I want to make a specific cell on a spread sheet I've created mandatory
before the document can be saved. For example; L2 must have a data entry
before document can be saved.

Is this possible, if so, how do I do it.


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
Linking Groups of cells between workbooks vnacj-joe Excel Discussion (Misc queries) 4 June 14th 07 05:18 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Check/Tick box's and Mandatory cells Libby Excel Discussion (Misc queries) 2 January 21st 05 01:07 PM
Help adding text values Texas-DC_271 Excel Worksheet Functions 7 January 15th 05 11:14 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM


All times are GMT +1. The time now is 11:56 AM.

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

About Us

"It's about Microsoft Excel"