I'm using vba code to import an Excel worksheet and not getting all the records because one of the records is missing a value in the first column. All of the records will always have a value in the 3rd column, but might be missing a value in the 1st and/or 2nd column. How can I ensure that I'm getting all rows with a value in the 3rd column?
Do While xlc1.Value <> ""
rst1.AddNew
rst1.Fields(0).Value = xlc1.Offset(0, 0).Value
rst1.Fields(1).Value = xlc1.Offset(0, 1).Value
rst1.Fields(2).Value = xlc1.Offset(0, 3).Value
rst1.Fields(3).Value = xlc1.Offset(0, 4).Value
rst1.Fields(4).Value = xlc1.Offset(0, 6).Value
rst1.Update
Set xlc1 = xlc1.Offset(1, 0)
Loop
Please don't question why I'm using vba code or suggest other methods of importing an Excel file. I have my reasons. Just wondering how I can avoid the Loop from stopping prematurely.
Thanks for your help.