We have an excel workbook with 12 worksheets in it that gets sent to our department each month. We import the data from each of the 12 worksheets into 12 corresponding tables in MS Access and do a whole bunch of processing of the data. Because of data entry errors in the worksheets, we frequently get import errors. I wrote a data validation module in the Excel workbook that checks for nulls, empty strings, invalid data types, etc. Each time it finds an error, it concatonates 3 pieces of information (sheet name, row, column) to a global string variable as follows.
gstrError = gstrError & “Error: Sheet ” & strSheet & ” Row ” & intRow & ” Col ” & intCol & vbCrLf
When all 12 worksheets have been checked, we end up with a string who’s value looks like this:
Error: Sheet Client Management Row 1 Col 2
Error: Sheet Client Management Row 7 Col 3
Error: Sheet Client Services Row 7 Col 2
Error: Sheet Commissions Row 7 Col 2
Error: Sheet OnSite Part3 Row 1 Col 7
I want to read the value of this string variable line by line into the last worksheet called “Error Log” so that each line is a new row.
What is the best way to do this?
Thanks,