Read cell in a for each row

need to read in the same column every cell into it (Cell by cell)

1 Like

If your datatable and excel file are aligned, to read each row you need to specify the row number in the range.

You could use the index of the for each row + 2 (header row + excel starts at index 1).

so it could be Read Cell - Range = "AE"+ intRowIndex.tostring

image

Hi @Soudios ,

Would you be so kind as to explain a bit more as to what it is you are trying to achieve with this code?

We can come up with a proper end to end resolution once we get a clear picture and maybe even suggest some enhancements.

Kind Regards,
Ashwin A.K

i need to read a cell into a for each activity but not the same cell ( i need to read the cell corresponding to the for each) AE1 AE2 AE2…

Hi @Soudios ,

The Range is a combination of Letters and Numbers e.g. A1, A2…
So in your case, you have to do this:

"AE" + Int_Index.ToString

If even the letters are dynamic, we can works something out.

Kind Regards,
Ashwin A.K

Hi @Soudios

Here is the sample workflow

ReadCell.xaml (7.3 KB)

Regards
Gokul

i can’t use the counter in this case because the row doesnt start from row 1 and the next row is not necessary row 2

@ashwin.ashok

i can’t find Int_Index.

Sorry, I mean int_RowIndex.

"AE" + Int_RowIndex.ToString

Kind Regards,
Ashwin A.K

Don’t do this. You don’t loop through and read the cells one by one. Use Read Range to get the whole sheet into a datatable. Then you use the datatable to do what you want.

@postwick

Ok for reading the datatable its ok but how can i do to write on the right cell on following to good index

@ashwin.ashok

how can i have Int_RowIndex ??

I can’t find it ? did i need to add a assign ?

You don’t write back to individual cells. Read the whole sheet into a datatable, manipulate the data in the datatable, then write the whole thing back to Excel.

1 Like