【说明】

标准Sub/Function定义,带ScreenUpdating、On Error GoTo

Sub AutoFillRole()
    '--------------- ERROR MSG------------------------------
    On Error GoTo errorhandle:
    'On Error Resume Next
    '--------------- ERROR MSG------------------------------
    Application.ScreenUpdating = False






    Application.ScreenUpdating = ture

    '--------------- ERROR MSG------------------------------
    Exit Sub
errorhandle:
    If Err.Number > 0 Then
        MsgBox Err.Description & " " & Err.Number
    End If
    '--------------- ERROR MSG------------------------------
End Sub

 

Function FindRole(key As String) As String
    '--------------- ERROR MSG------------------------------
    On Error GoTo errorhandle:
    'On Error Resume Next
    '--------------- ERROR MSG------------------------------
    Application.ScreenUpdating = False
    






    Application.ScreenUpdating = ture
    '--------------- ERROR MSG------------------------------
    Exit Function
errorhandle:
    If Err.Number > 0 Then
        MsgBox Err.Description & " " & Err.Number
    End If
    '--------------- ERROR MSG------------------------------
End Function

 

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-09-22
  • 2021-10-29
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案