I am trying to export an excel file to an access database. Certain columns/fields need to have field type number, because these fields will be used later on in queries involving functions like sum, count etc.
Now the problem is that the corresponding columns in excel contain empty strings that create problem while exporting to access database (field type mismatch). Even if these columns in excel have the cells formatted as numbers, the problem persists
I used the following VBA Code to eliminate all the empty strings in these columns and it works for a decent number of rows. But the excel file will have 350000 plus rows, and for such a large number of rows, the code seems to run forever.
Any tips on improving my code or taking another approach will be highly appreciated
Dim r As Range
For Each r In ActiveSheet.Range("AG2:AJ" & lastRow)
With r
If .Value = "" Then
.Clear
End If
End With
Next