Arash_The_A_Level_Student
New Member
- Joined
- Feb 16, 2002
- Messages
- 38
Hi Could I have the code for automatically saving and exiting a workbook also when this is done 250 times I would like a message box to come up to say a custom message
On 2002-03-07 12:48, Arash_The_A_Level_Student wrote:
Sub Exit_Save()
'
' Exit_Save Macro
' Exits And Saves The Excel Workbook
Dim Wkbk As Workbook
Dim i As Integer
'Turn off alerts if you don't care about overwriting workbooks with the same names
Application.DisplayAlerts = False
For Each Wkbk In Workbooks
If Not Wkbk Is ThisWorkbook Then
Wkbk.Save
Wkbk.Close
i = i + 1
If i = 2 Then
MsgBox "You have Saved Your Invoice 250 Times, It's Time To Save Your Invoice Onto Removeable Media"
End If
End If
Next
End Sub
'
This is the code I have entered on the VB editor but it doesn't work could you please give more assistance, thanks