简单的vbscript - 未从电子表格返回的值

时间:2012-05-28 11:51:11

标签: vbscript macros

If ActiveSheet.Cells(myRow, 3).Value = "" Then
    APCtext = "" & APC = 2
ElseIf ActiveSheet.Cells(myRow, 3).Value = "?" Then
    APCtext = "Unknown" & APC = 3
Else
    APCtext = ActiveSheet.Cells(myRow, 3).Value & APC = 1
End If

这应该得到的第一个值不是空白或问号,但是它不会在else部分返回此值。任何人都可以指出这段代码有什么问题吗?

1 个答案:

答案 0 :(得分:0)

试试这个:

If ActiveSheet.Cells(myRow, 3).Value = "" Then
    APCtext = ""
    APC = 2
ElseIf ActiveSheet.Cells(myRow, 3).Value = "?" Then
    APCtext = "Unknown"
    APC = 3
Else
    APCtext = ActiveSheet.Cells(myRow, 3).Value
    APC = 1
End If