vba运行提示类型不匹配
Sheet2.Cells(4,4)=Sheet2.Cells(4,4)&Sheet2.Cells(a,4)&Sheet2.Cells(a,5)Sub按钮41_单击()Di...
Sheet2.Cells(4, 4) = Sheet2.Cells(4, 4) & Sheet2.Cells(a, 4) & Sheet2.Cells(a, 5)
Sub 按钮41_单击()
Dim a As Integer, b As Integer, c As Integer
For a = 5 To 51
If Sheet2.Cells(a, 4) <> "Y" Then
If Sheet2.Cells(4, 4) <> "" Then
Sheet2.Cells(4, 4) = Sheet2.Cells(a, 4) & Sheet2.Cells(a, 5) & "、"
Else
Sheet2.Cells(4, 4) = Sheet2.Cells(4, 4) & Sheet2.Cells(a, 4) & Sheet2.Cells(a, 5)
End If
End If
Next a
End Sub
If Sheet2.Cells(a, 4) <> "Y" Then
这一步也报错,同样的错误 展开
Sub 按钮41_单击()
Dim a As Integer, b As Integer, c As Integer
For a = 5 To 51
If Sheet2.Cells(a, 4) <> "Y" Then
If Sheet2.Cells(4, 4) <> "" Then
Sheet2.Cells(4, 4) = Sheet2.Cells(a, 4) & Sheet2.Cells(a, 5) & "、"
Else
Sheet2.Cells(4, 4) = Sheet2.Cells(4, 4) & Sheet2.Cells(a, 4) & Sheet2.Cells(a, 5)
End If
End If
Next a
End Sub
If Sheet2.Cells(a, 4) <> "Y" Then
这一步也报错,同样的错误 展开
展开全部
如果这个单元格里是数字或者日期的话, 和文本"Y"进行比较就会报错
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sheet2.Cells(4, 4).value
Sheet2.Cells(4, 4)是单元格对象,value是单元格的值,后面几个也是加上value
Sheet2.Cells(4, 4)是单元格对象,value是单元格的值,后面几个也是加上value
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询