I'm hoping to find a way to check if a certain cell in my excel file contains certain values.
Right now I'm pulling excel data into a datagridview in vb.net.
For instance, if only numbers are allowed in my cell but a letter is in place, I want the program to automatically change invalid entries to default values. Also I'm hoping to have an integer variable that increments by one if invalid entries are found.
Pseudocode:
First I need to define some type of integer variable named invalidcell,
and initialize to 0.
For each worksheet
For each cell in each worksheet
If an invalid cell is read then:
the invalid cell value is replaced by the default value,
and the invalidcell is incremented by 1.
End If
End loop
End loop
Then when all the cells have been imported, display an error message if the invalidcell is > 0, that says how many invalidcells were found.
I greatly appreciate any help or suggestions anyone can give.