Excel VBA导入数组条件

时间:2016-05-31 15:41:33

标签: arrays excel vba excel-vba

我有两个数组,有一堆条件评估数据。

And Not Left(CStr(Cells(r, cA)), 1) = "8" And Not Cells(r, cH) = "-190001010000" Or Cells(r, cH) = "190001010000" Then

现在我将所有单元格放在第r行和第cA列中,以' 8'开头。进入阵列2。

但我希望行r和列cA中的所有单元格,而单元格r,CH等于' -190001010000'或等于' -190001010000'进入阵列2.

我不相信条件陈述的后半部分正在评估吗?

以下是完整条件:

                        If Not Left(CStr(Cells(r, cC)), 3) = "722" _
                        And Not CStr(Cells(r, cC)) = "32DP2C" _
                        And Not CStr(Cells(r, cC)) = "325SFC" _
                        And Not CStr(Cells(r, cC)) = "78462F103" _
                        And Not CStr(Cells(r, cM)) = "Fofprice" _
                        And Not Cells(r, cH) = "-190001010000" _
                        And Not Cells(r, cH) = "190001010000" Then
                        'And 'Not (Left(CStr(Cells(r, cA)), 1) = "8") Then

1 个答案:

答案 0 :(得分:0)

尝试put()

And Not Left(CStr(Cells(r, cA)), 1) = "8" And (Cells(r, cH) = "-190001010000" Or Cells(r, cH) = "190001010000") Then

我在细胞(r,cH)之前注意到“Not”。你想要它不等于-190 ......或190 ......?

或者你想要它等于-190 ......或190 ......?