How to stop VBA code running?

后端 未结 7 776
臣服心动
臣服心动 2020-12-08 11:22

Say I have a button embedded into my spreadsheet that launches some VBA function.

Private Sub CommandButton1_Click()
    SomeVBASub
End Sub

Private Sub Some         


        
7条回答
  •  有刺的猬
    2020-12-08 12:20

    what jamietre said, but

    Private Sub SomeVBASub
        Cancel=False
        DoStuff
        If not Cancel Then DoAnotherStuff
        If not Cancel Then AndFinallyDothis
    End Sub
    

提交回复
热议问题