none
need makro function CHOSE false , true RRS feed

  • Question

  • Hey group...

    ive got this Makro script when ive run it, the first Msgbox apear (Husk AT INDSÆTTE KAMPNR)

    when ive press ok the next msgbox apear and there is my wonder ....The msgbox SHOULD NOT SHOWS

    it may ONLY apear when there was data in cell "E6" and "E8"

    When ive run it and there is data in those cell's then Msgbox (Husk AT Insætte Kampnr) not show and that is OK

    are there any who could help mee with that function

    your regards from Henrik in Denmark

    Sub TurnTabIntoPDF()

    With ActiveSheet

    If IsEmpty(Range("E6")) Or IsEmpty(Range("E8")) Then
    MsgBox "Husk AT INDSÆTTE KAMPNR", vbOK + vbInformation, "HUSK KAMP NUMMER"
             Cancel = False
        Else: End If

    If MsgBox("Ønsker du at se Kampseddel i PDF Format", vbYesNo, " Se Kampseddel Ja - nej") = vbYes Then
    Call TurnTabIntoPDF2
    On Error Resume Next
    .ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    ActiveWorkbook.Path & "\" & .Range("E6") & " " & .Range("E8").Value & " " & .Range("R6").Value & " " & .Range("R7").Value, Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True


    End If
    End With
    End Sub


    Sub TurnTabIntoPDF2()

    With ActiveSheet

    On Error Resume Next
    .ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    ActiveWorkbook.Path & "\" & .Range("E6") & " " & .Range("E8").Value & " " & .Range("R6").Value & " " & .Range("R7").Value, Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=False

    End With
    End Sub

    Sunday, October 5, 2014 3:02 PM

Answers

  • Instead of the line

              Cancel = False

    use

              Exit Sub

    I think you should either call TurnTabIntoPDF2 or use .ExportAsFixedFormat in TurnTabIntoPDF, not both.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Sunday, October 5, 2014 3:49 PM
  • Dear Hans

    first of all THANKS for the "Exit sub" that's Works great

    Your Regards From Henrik (Denmark)

    • Marked as answer by Henrik-1 Sunday, October 5, 2014 8:34 PM
    Sunday, October 5, 2014 8:34 PM

All replies

  • Instead of the line

              Cancel = False

    use

              Exit Sub

    I think you should either call TurnTabIntoPDF2 or use .ExportAsFixedFormat in TurnTabIntoPDF, not both.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Sunday, October 5, 2014 3:49 PM
  • Dear Hans

    first of all THANKS for the "Exit sub" that's Works great

    Your Regards From Henrik (Denmark)

    • Marked as answer by Henrik-1 Sunday, October 5, 2014 8:34 PM
    Sunday, October 5, 2014 8:34 PM