I have two values in the same column in Excel. I select one of them and run the following:
Debug.Print IsNumeric(Selection), _
VarType(Selection), _
VarType(Trim(Selection)), _
">" & Selection.Value & "<", _
Len(Trim(Selection)), _
Len(Selection), _
Selection.NumberFormat
Then I select the other and run the same debug.
And I get this:
- True, 5, 8, >9.46979663546499<, 16, 16, General
- False, 8, 8, ><, 0, 0, General
Note: the column has multiple occurrences of both
- Can someone explain this? I've been vba'ing and Excel'ing a long time and I still don't get (in detail) the number formatting Excel does and how to work with them best. I think I have it then I always stumble upon something new like this.
- In this case my objective is to get MS Access to automatically understand that this column is a double/number/float/whatever column that can be NULL when I import it and not throw errors. I have to achieve this through formatting/changing it in Excel prior to importing it. (Partly because that will work best with my client's processes and partly because I want to get my head around this finally...can't believe I don't already!) I have over 2000 rows to change for each column so a solution that formats the entire column at once would be best, not just one cell at a time.
Thanks!