C
cskgg
Hello all,
Need help in the following:
I want the user to enter an ACCOUNT CODE in a workbook BEFORE they
can save it. That is, whenever the user clicks on the SAVE button
or clicks on File > save, the system must check if ACCOUNT CODE is
present in the specified cell, otherwise it should prompt the user
input the account code first before saving.
I checked the VB-Help and the code it showed is a PRIVATE FUNCTION.
I cannot use it in its present form.
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
ByVal SaveAsUI As Boolean, Cancel as Boolean)
a = MsgBox("Do you really want to save the workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub
(by the way, when can we use PRIVATE FUNCTIONS??)
Any suggestions ???
Many thanks/Cheers.
cskg
Need help in the following:
I want the user to enter an ACCOUNT CODE in a workbook BEFORE they
can save it. That is, whenever the user clicks on the SAVE button
or clicks on File > save, the system must check if ACCOUNT CODE is
present in the specified cell, otherwise it should prompt the user
input the account code first before saving.
I checked the VB-Help and the code it showed is a PRIVATE FUNCTION.
I cannot use it in its present form.
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
ByVal SaveAsUI As Boolean, Cancel as Boolean)
a = MsgBox("Do you really want to save the workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub
(by the way, when can we use PRIVATE FUNCTIONS??)
Any suggestions ???
Many thanks/Cheers.
cskg