Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dan Raab
 
Posts: n/a
Default Disallow File Save if No Input in Cells?


Is there any way to require data entry into cells such that the
save/save as functions can be disabled until the data is entered?

Thanks,

Dan


--
Dan Raab
------------------------------------------------------------------------
Dan Raab's Profile: http://www.excelforum.com/member.php...o&userid=29414
View this thread: http://www.excelforum.com/showthread...hreadid=499474

  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Disallow File Save if No Input in Cells?

You can use the BeforeSave event procedure to do this. In the
ThisWorkbook code module, use the following code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel
As Boolean)
If Worksheets("Sheet1").Range("A1") = "" Then
Cancel = True
End If
End Sub


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



"Dan Raab"
wrote in message
...

Is there any way to require data entry into cells such that the
save/save as functions can be disabled until the data is
entered?

Thanks,

Dan


--
Dan Raab
------------------------------------------------------------------------
Dan Raab's Profile:
http://www.excelforum.com/member.php...o&userid=29414
View this thread:
http://www.excelforum.com/showthread...hreadid=499474



  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Disallow File Save if No Input in Cells?

Maybe....

Saved from a previous post:

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim myRng As Range
Dim myEmptyRng As Range
Dim myCell As Range

Set myRng = Me.Worksheets("Form").Range("a1,b9,c12,d13")

If Application.CountA(myRng) 0 _
And Application.CountA(myRng) < myRng.Cells.Count Then
Cancel = True
For Each myCell In myRng.Cells
If IsEmpty(myCell) Then
If myEmptyRng Is Nothing Then
Set myEmptyRng = myCell
Else
Set myEmptyRng = Union(myEmptyRng, myCell)
End If
End If
Next myCell
MsgBox myEmptyRng.Address(0, 0) & " must have valid data!"
End If
End Sub

If all the cells are empty, you can still save (nice for changing the master).
But there are other techniques if you don't want to allow all empty cells.

this code goes behind the ThisWorkbook module.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



Dan Raab wrote:

Is there any way to require data entry into cells such that the
save/save as functions can be disabled until the data is entered?

Thanks,

Dan

--
Dan Raab
------------------------------------------------------------------------
Dan Raab's Profile: http://www.excelforum.com/member.php...o&userid=29414
View this thread: http://www.excelforum.com/showthread...hreadid=499474


--

Dave Peterson
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
I get error messages in Excel cells once I save a file JeffJake Excel Worksheet Functions 1 November 28th 05 11:06 PM
Locking The Cells with Input At The Time of Saving The File In Calif Excel Discussion (Misc queries) 2 September 10th 05 05:33 PM
User cannot save excel file in workbook Justin@Martin Excel Worksheet Functions 0 May 16th 05 01:52 PM
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
How do you disable save file dialog? someone Setting up and Configuration of Excel 2 February 13th 05 12:02 AM


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