Question

  • Creator
    Topic
  • #2149677

    MS Excel / Visual Basic

    Locked

    by john.hart ·

    I wrote:

    Sub SomePilot()
    M = Format(Now, “MMM”)
    Application.ScreenUpdating = False
    M = InputBox(“Input month you would like to print.”, “Month Entry”, M)
    Worksheets(“162 PILOT”).Select
    Cells(1, 15).Font.Size = 20
    Cells(1, 15) = M
    Cells(4, 1).Font.Size = 20
    Cells(4, 5).Font.Size = 20
    Cells(4, 11).Font.Size = 20
    a = Cells(1, 36).Value
    Cells(4, 1) = Cells(a, 33)
    Cells(4, 5) = Cells(a, 34)
    Cells(4, 11) = Cells(a, 35)
    Worksheets(“162 PILOT”).PrintOut
    Cells(4, 1) = ” ”
    Cells(4, 5) = ” ”
    Cells(4, 11) = ” ”
    Cells(1, 15) = ” ”
    Sheets(“Inputs”).Select
    Range(“A4”).Select
    Application.ScreenUpdating = True
    End Sub

    I assumed when you used an input box function the cancel button would cancel the operation instead it returns a null value and proceeds through the rest of the code.

All Answers

Viewing 0 reply threads