运行时错误424要求对象 20
PrivateSubCalendar2_Click()ActiveCell=Calendar2.ValueMe.Calendar2.Visible=FalseEndSub...
Private Sub Calendar2_Click()
ActiveCell = Calendar2.Value
Me.Calendar2.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
ElseIf Target.Column = 2 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
ElseIf Target.Column = 5 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
Else
Calendar2.Visible = False
End If
End Sub
这是代码,我的Excel里面有好几个表格,为什么在第一个表格就行,别的表格就提示运行时错误424要求对象,这是为什么啊,,大神们指教指教 展开
ActiveCell = Calendar2.Value
Me.Calendar2.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
ElseIf Target.Column = 2 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
ElseIf Target.Column = 5 Then
Calendar2.Left = Target.Left + Target.Width
Calendar2.Top = Target.Top + Target.Height
Calendar2.Value = Date
Calendar2.Visible = True
Else
Calendar2.Visible = False
End If
End Sub
这是代码,我的Excel里面有好几个表格,为什么在第一个表格就行,别的表格就提示运行时错误424要求对象,这是为什么啊,,大神们指教指教 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询