vba: passing a variable into error handles

后端 未结 4 1702
后悔当初
后悔当初 2021-01-25 13:22

i have a statement:

on error go to label

however i would like to pass into the label the variable which caused the error

is this possib

4条回答
  •  清歌不尽
    2021-01-25 13:44

    Declare global variables and use them in the code and in your error code.

    Public global_variable1 As Integer
    Public global_variable2 As String
    
    Private Sub Btn1234_Click()
    ....
    end sub
    
    Err_abcd:                           
    ....
    End Sub
    

提交回复
热议问题