Erros message: If Column X: There is no row at position XX

Hello,
I am trying to read and pull one DB trought if statement in order to test if cell is not empty.
dt_SLB_Page1.Rows(int_counter_row).Item(0).toString <>"" And dt_FI_Page1.Rows(int_counter_row).Item(0).toString <>""

If column is not empty in both of tables, then I am comparing them. If not, I am writing not empy one in excel:
Write Cell (dt_SLB_Page1.Rows(int_counter_row).Item(0).toString +dt_FI_Page1.Rows(int_counter_row).Item(0).toString).

Somehow I am getting thrown out at, with an error message:
If Column H: There is no row at position 61.

The column is empty indeed. There is no value, but it not the first empty column. Why is this happening and how to avoid this?

Second problem is, that cell written down trough else stemement - (when value is available only in one column) is saved in exel as text format. How can I change them to be saved as numebr format?
(dt_SLB_Page1.Rows(int_counter_row).Item(0).toString +dt_FI_Page1.Rows(int_counter_row).Item(0).toString)

Thanks!

Try For each row activity to iterate through each row. row(0).ToString will give you 1st row 1st column value. Print it in message box so that you can know value. If it works then add the condition.

If the problem still exists send me the source file. :innocent:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.