查看: 22  |  回复: 0
  VBA代码 判断表存在
楼主
发表于 2025年3月18日 10:09
Function ShtExists(shtname)
    '判断Sheet表是否存在
    On Error Resume Next
    Dim s
    Err.Clear
    s = Sheets(shtname & "").name
    
    If Err.Number = 0 Then
        ShtExists = True
    Else
        ShtExists = False
    End If
End Function


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2025 MaNongKu.com