Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following macro for a button that saves a file in two locations. I want to put a condition between the code that would create a pop up message saying that Date cell (Which is in C6) must be filled before saving the file. My code is as follows: Private Sub CmdSubmit_Click() If MsgBox("Submit: '" & Sheet1.Cells(1, 1) & "?", vbYesNo Or vbQuestion _ Or vbDefaultButton2) = vbYes Then 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 If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
deleting rows in a worksheet if condition is met | Excel Discussion (Misc queries) | |||
Condition for worksheet reference | Excel Worksheet Functions | |||
copy row content from one worksheet to another, if a condition met | Excel Worksheet Functions | |||
copy data from 1 worksheet to another based on a condition | Excel Worksheet Functions | |||
how to hide section of worksheet based on a condition (e.g. tick . | Excel Discussion (Misc queries) |