Results 1 to 14 of 14

Prevent save unless all cells or certain cells are filled in

Threaded View

  1. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        If WorksheetFunction.CountA(Sheets("Sheet1").Range("B5,C9")) < 2 Then
        Cancel = True
        Msg = MsgBox("Please complete cell B5 and C9 to continue ", vbOKOnly)
    Else
        If WorksheetFunction.CountA(Sheets("Sheet1").Range("B5,C9")) = 2 Then
        Cancel = False
        End If
    End If
    End Sub
    VBA Noob
    Last edited by VBA Noob; 12-02-2007 at 10:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1