Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sierra Coating
 
Posts: n/a
Default Can I get Excel not to save a file if certain information is not i

I would like to know if there is a way that I can set up a file that will not
allow someone to close it until certain cells are filled in.
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

In the Thisworkbook's codemodule, put this type of code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then Cancel = True
If Worksheets("Sheet2").Range("B2").Value = "" Then Cancel = True
' and so on for each cell that you require to be filled in
End Sub


--
HTH,
Bernie
MS Excel MVP


"Sierra Coating" <Sierra wrote in message
...
I would like to know if there is a way that I can set up a file that will not
allow someone to close it until certain cells are filled in.



  #3   Report Post  
Chip Pearson
 
Posts: n/a
Default

This can be done only with VBA code. In the ThisWorkbook code
module, use code similar to the following:


Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Range("A1") = "" Then ' change A1 to the desired cell
Cancel = True
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Sierra Coating" <Sierra wrote
in message
...
I would like to know if there is a way that I can set up a file
that will not
allow someone to close it until certain cells are filled in.



  #4   Report Post  
Sierra Coating
 
Posts: n/a
Default

I am putting this info into Visual Basic Editor under Module - it is not
working I pasted yout code and inserted my information (i.e. sheet names and
cell numbers) but it is not working - do you know what I am doig wrong?

"Bernie Deitrick" wrote:

In the Thisworkbook's codemodule, put this type of code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then Cancel = True
If Worksheets("Sheet2").Range("B2").Value = "" Then Cancel = True
' and so on for each cell that you require to be filled in
End Sub


--
HTH,
Bernie
MS Excel MVP


"Sierra Coating" <Sierra wrote in message
...
I would like to know if there is a way that I can set up a file that will not
allow someone to close it until certain cells are filled in.




  #5   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

You need to double-click on the ThisWorkbook object of your workbook within the project explorer -
press Ctrl-R to get the project explorer to show - and then paste the code in the window that
appears.

HTH,
Bernie
MS Excel MVP


"Sierra Coating" wrote in message
...
I am putting this info into Visual Basic Editor under Module - it is not
working I pasted yout code and inserted my information (i.e. sheet names and
cell numbers) but it is not working - do you know what I am doig wrong?

"Bernie Deitrick" wrote:

In the Thisworkbook's codemodule, put this type of code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then Cancel = True
If Worksheets("Sheet2").Range("B2").Value = "" Then Cancel = True
' and so on for each cell that you require to be filled in
End Sub


--
HTH,
Bernie
MS Excel MVP


"Sierra Coating" <Sierra wrote in message
...
I would like to know if there is a way that I can set up a file that will not
allow someone to close it until certain cells are filled in.






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
Putting Excel formatting and/or formulas into CSV file Frank D. Nicodem, Jr. Excel Discussion (Misc queries) 1 July 11th 05 10:18 PM
'document not saved' for 'save' or 'save as' an EXCEL file Judy Chuang Excel Discussion (Misc queries) 1 July 11th 05 10:12 PM
Excel prompts me to save a copy or overwrite file. Vinny Excel Worksheet Functions 0 May 20th 05 03:05 PM
How do I save a copy of an excel file without the formulas? Saving Excel File without Formula Excel Worksheet Functions 1 February 14th 05 08:55 PM
INFO: ON EXCEL SPREADSHEET FILE mytoy New Users to Excel 3 December 17th 04 11:48 PM


All times are GMT +1. The time now is 05:24 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"