View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Requiring multiple cells to be populated before allowing Save

Hi Alan,

Thanks for your solution. I assume I should precede your code with:

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

Is that true?

Thanks again for your help!
Bob


"Alan McQuaid via OfficeKB.com" wrote:

Hi Bob,

You could try:

For Each iCell In Sheets("Sheet1").Range("M2:M25")
If IsEmpty(Sheets("Sheet1").Range(iCell.Address)) Then
Cancel = True
MsgBox ("The workbook cannot be saved until cell " & iCell.Address & " has
been populated.")
Exit Sub
End If
Next iCell


Alan

--
Message posted via http://www.officekb.com