Consulting

Results 1 to 4 of 4

Thread: COMBING MACROS

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    COMBING MACROS

    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
    Last edited by SamT; 09-13-2016 at 08:25 AM. Reason: Used # Icon to add CODE Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •