我的小脚本在单元格中不显示任何内容

时间:2019-11-20 15:25:00

标签: excel vba

我有两个单元格,一个单元格有价值,另一个单元格为空。 我的脚本应该写出其中的单元格值,并用N / A替换空的单元格

该脚本设法使空的N / A不可用,但是它也使具有值的单元格为空白?我应该如何解决这个问题。

Function ColumnValue(RefColObject, ColumnObject, BaseRowIndex, BaseColumnIndex)
    ColumnValue = ""

    If ColumnObject Is Nothing Then Exit Function

    att1 = Len(ColumnObject.Value)

    If att1 = 0 Then
        ColumnValue = "N/A"
    Else
        ColumnObject.DisplayValue
    End If
End Function

0 个答案:

没有答案