VBA运行老是显示类型不匹配
PrivateSubCommandButton1_Click()Dimabc()ASVariantDimaba()ASVariantDimxAsVariantx=NowR...
Private Sub CommandButton1_Click()
Dim abc() AS Variant
Dim aba()
AS Variant
Dim x As Variant
x = Now
ReDim aba(60)
ReDim abc(60)
For i = 2 To 58
abc(i) = Range("C2:C" & i)
aba(i) = Range("E2:E" & i)
If abc(i) = "" And aba(i) = "YES" Then
Range("C" & i) = x
End If
Next
End Sub
看看这段VBA代码是怎么回事? 老是显示不匹配,谢谢!我的目的就是想达到在EXCEL中添加了个按钮,CHICK事件判断是否启用列数值为“YES”和对应C列有没有填时间,没有就自动将NOW填入。 展开
Dim abc() AS Variant
Dim aba()
AS Variant
Dim x As Variant
x = Now
ReDim aba(60)
ReDim abc(60)
For i = 2 To 58
abc(i) = Range("C2:C" & i)
aba(i) = Range("E2:E" & i)
If abc(i) = "" And aba(i) = "YES" Then
Range("C" & i) = x
End If
Next
End Sub
看看这段VBA代码是怎么回事? 老是显示不匹配,谢谢!我的目的就是想达到在EXCEL中添加了个按钮,CHICK事件判断是否启用列数值为“YES”和对应C列有没有填时间,没有就自动将NOW填入。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询