How to get the specific Row Number in excel?

Hello , i have met a problem. When I use “for each row”, it will choose the most maximum row to stop. How to get the Specific number of row?


Not specific single number of row,just like below:

So it will cause a problem, When the cell is blank, it don’t stop , it will continue to read.
Finally like this

@z1185399190

You can try this qctivity with selecting only the column you need

https://docs.uipath.com/activities/other/latest/productivity/find-first-last-data-row-x

Then use the output subsequently to loop

Cheers

1 Like

Hi @z1185399190

Try this

String.IsNullOrEmpty(CurrentRow.ByField("ColumnName").ToString) Or String.IsNullOrWhiteSpace(CurrentRow.ByField("ColumnName").ToString)

Thanks,
Pallavi

1 Like

@z1185399190,

While iterating from For Each Row, add one If condition to check if the desired column have some value or not. If it’s blank or no value, that is your end row.

Use Break activity and your bot execution will come out of the For Each loop.

Thanks,
Ashok :slight_smile:

1 Like

@z1185399190

Using If activity check for blank cells and if encountering a blank cell indicates the end of your data, you can use a condition to terminate the loop suing break activity.

HAPPY AUTOMATION!!

1 Like

Thank you very much~

1 Like

Thank you very much :smiley_cat:

Thank you very much!

1 Like

Yes i am trying to use this way :smiley_cat:

1 Like

@z1185399190

Please note the selected method might not work…if there is a blank row or blank cell in between …as it would assume that is the final row

Cheers

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