Results 1 to 2 of 2

Thread: Auto close

  1. #1
    snax500
    Guest

    Auto close

    In Excel2000, I have the following auto close macro:

    Sub Auto_Close()
    For Each cell In Range("c88")
    If cell > 0 Then
    If cell.Offset(3, 0) = 0 Then
    MsgBox "Please check that Margin% is complete"
    End If
    End If
    Next
    End Sub

    I then want the macro to stop the user from leaving the file so that they can fix their error. How do I stop the closing of the file after my error message?

    Thanks

  2. #2
    Lounger
    Join Date
    Apr 2001
    Location
    Johannesburg
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto close

    Hallo, I am not an expert but I think you should try the following:
    Put your code in the Workbook_BeforeClose event. Then you will have an option to cancel the closing event. Search XLHelp for BeforeClose for more info.

Posting Permissions

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