R
Ragnar Midtskogen
Hello,
I am parsing a spreadsheet and as part of the process I have to check what
is in the cells in column A.
The content is either a numeric character string, "019" for example, or
"#N/A"
The code below works fine as long as the cell contains a numeric string, but
when it contains "#N/A"
the behavior is strange.
Dim oSourceSheet As WorkSheet
If I use the Text propery, like this:
sRegionNumber = oSourceSheet.Cells(lnFirstRow, 1).Text
sRegionNumber is set to a Null string.
If I use the default propery (Value?), like this
sRegionNumber = oSourceSheet.Cells(lnFirstRow, 1)
sRegionNumber is set to "Error 2042"
I suppose I can use the text property and check for null string, but then I
would not be able to detect
the case if the cell did contain a null string.
Any help with this would be very much appreciated.
Ragnar
I am parsing a spreadsheet and as part of the process I have to check what
is in the cells in column A.
The content is either a numeric character string, "019" for example, or
"#N/A"
The code below works fine as long as the cell contains a numeric string, but
when it contains "#N/A"
the behavior is strange.
Dim oSourceSheet As WorkSheet
If I use the Text propery, like this:
sRegionNumber = oSourceSheet.Cells(lnFirstRow, 1).Text
sRegionNumber is set to a Null string.
If I use the default propery (Value?), like this
sRegionNumber = oSourceSheet.Cells(lnFirstRow, 1)
sRegionNumber is set to "Error 2042"
I suppose I can use the text property and check for null string, but then I
would not be able to detect
the case if the cell did contain a null string.
Any help with this would be very much appreciated.
Ragnar