Chris2460
09-13-2016, 02:32 AM
Hello all I am trying to combine these two macros
Sub CheckIfCellIsEmpty()
Dim isMyCellEmpty As Boolean
isMyCellEmpty = IsEmpty(Range("D48"))
If isMyCellEmpty = True Then
MsgBox "Intelligence Report Requires Completing & the Box Selected"
End If
End Sub
------------------------------------------------------------------------------------
Option Explicit
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
FPath = "z:\i Wing\Names"
FName = Format$(Date, "yyyy-mm-dd") & " " & Sheets("Sheet1").Range("D12").Text
ThisWorkbook.SaveAs Filename:=FPath & "\" & FName
End Sub
The macro I am using is this:
Sub RunAll()
Call CheckIfCellIsEmpty
Call SaveAsExample
End Sub
When it runs the msg box comes up if D48 is not complete, however when I click OK it just continues to the second part of the macro ie: saveas.... Any thoughts
Sub CheckIfCellIsEmpty()
Dim isMyCellEmpty As Boolean
isMyCellEmpty = IsEmpty(Range("D48"))
If isMyCellEmpty = True Then
MsgBox "Intelligence Report Requires Completing & the Box Selected"
End If
End Sub
------------------------------------------------------------------------------------
Option Explicit
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
FPath = "z:\i Wing\Names"
FName = Format$(Date, "yyyy-mm-dd") & " " & Sheets("Sheet1").Range("D12").Text
ThisWorkbook.SaveAs Filename:=FPath & "\" & FName
End Sub
The macro I am using is this:
Sub RunAll()
Call CheckIfCellIsEmpty
Call SaveAsExample
End Sub
When it runs the msg box comes up if D48 is not complete, however when I click OK it just continues to the second part of the macro ie: saveas.... Any thoughts