VBA Debug.Print A范围值

时间:2015-07-20 03:05:56

标签: vba excel-vba excel

我很困惑为什么在运行此代码时出现类型不匹配错误。

我要做的就是记录c的值以进行调试,但我甚至无法做到这一点。

这是我的代码:

Dim c As Range
Dim queryaddress As Range
For Each queryaddress In worksheetname.Range("B2:B21")
Set queryrow = queryaddress.EntireRow
For Each c In queryrow
Debug.Print (c.Interior.Color)
Debug.Print (c.Address)
If WorksheetFunction.CountA(c) > 0 And c.Interior.Color = 0 Then
Debug.Print (c.Value)
'The above line creates a mismatch error
End If
Next c
Next queryaddress

0 个答案:

没有答案