小编hod*_*hod的帖子

事件宏引发错误"对象必需"

我有这个简单的事件宏,由于某种原因抛出我

所需对象

这条线上的错误If Not AppDate Is Nothing Then.知道可能导致这种情况的原因吗?

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim LastRow As Integer
    Dim ThisRow As String
    Dim AppDate As Variant
    Application.EnableEvents = False

    LastRow = Cells(Rows.Count, "C").End(xlUp).Row
    If Target.Column = 3 Then
        ThisRow = Target.Row
        AppDate = Target.Value
        If Not AppDate Is Nothing Then
            (...) Recalculate Date in Column F
        Else
        End If
    End If

    Application.EnableEvents = True
End Sub
Run Code Online (Sandbox Code Playgroud)

任何建议将不胜感激.谢谢!

excel events vba object excel-vba

1
推荐指数
1
解决办法
210
查看次数

标签 统计

events ×1

excel ×1

excel-vba ×1

object ×1

vba ×1