Saving Workbook

G

Guest

Right now, a button runs the following code:
---------------------------------------------------
Private Sub CmdSubmit_Click()

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Archive\" & Sheet1.Cells(1, 1).Value &
".xls"
Application.DisplayAlerts = True

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Batch_Files\" & Sheet1.Cells(1, 2).Value
& ".xls"
Application.DisplayAlerts = True

MsgBox ("File Submitted Successfully")

Application.ActiveWorkbook.Close

End Sub
------------------------------------------------
Please tell me how to incorporate a condition which checks if a (C6) is
filled in before saving the file. If cell C6 is empty, I want users to get a
message box stating that they MUST fill in an entry in C6 before saving the
file.

Thanks,

Yasser
 
D

Dave Peterson

See your first post.
Right now, a button runs the following code:
---------------------------------------------------
Private Sub CmdSubmit_Click()

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Archive\" & Sheet1.Cells(1, 1).Value &
".xls"
Application.DisplayAlerts = True

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Batch_Files\" & Sheet1.Cells(1, 2).Value
& ".xls"
Application.DisplayAlerts = True

MsgBox ("File Submitted Successfully")

Application.ActiveWorkbook.Close

End Sub
------------------------------------------------
Please tell me how to incorporate a condition which checks if a (C6) is
filled in before saving the file. If cell C6 is empty, I want users to get a
message box stating that they MUST fill in an entry in C6 before saving the
file.

Thanks,

Yasser
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top