LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Checking if some cells are empty when file is being saved

hi
you could use the before save event to check certain cells for input.
but since you didn't give a lot of details, i can only give a overly simple
answer.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim r As Range
Set r = Sheets("sheet1").Range("A2")
If r = "" Then
MsgBox "the require entry at " & r.Address & " need data!"
r.Select
Cancel = True
End If
End Sub

the above only check 1 cell and cancels save if no data in the cell.
you would need to reset r to the various cells that need input. not sure how
many you have.

regards
FSt1

"Bob Ptacek" wrote:

Is there something that can be checked if the "Save" function is executed.

I have a file with a number of worksheets and I don't want a user to be able
to save it without entering some data. Once the "save" is selected I would
like to check to see if all required fields are still empty so I can display
an error

 
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
Checking empty cells Diez Excel Programming 1 June 21st 06 08:32 AM
Checking for Empty Scattered Cells Kevin O'Neill[_2_] Excel Programming 2 January 4th 06 06:41 PM
Checking for empty cells in a range Chris Strug Excel Worksheet Functions 2 June 20th 05 10:33 AM
Checking if an Excel file is empty? Kintan Excel Programming 0 November 11th 04 03:24 AM
checking if file is saved John Excel Programming 1 August 29th 04 11:09 AM


All times are GMT +1. The time now is 04:05 AM.

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"