Condition stop when see lastrow

Hello all,

I read excel in For Each Row
lastrow: dtXml.rows.count+1 = 5 (include header)
idx: 0+2 (start to row 2)

I want when idx=lastrow, action enter stop but not stop. Can check for me.

can yu upload xaml here./? @anh.nguyen

1 Like

Read Multiple XML.xaml (277.3 KB)
Please help me check when lastrow will stop Enter. thank you

is this the wrong xaml/? i cannot find that if activity anywhere!

It’s correct bc have many activities, i minimun some activities for you to see easy


Read Multiple XML.xaml (277.3 KB)

what do you mean "
action enter stop but no stop?!!!?

1 Like

Yes, I want when loop to lastrow will not use “enter” hotkey. but when to lastrow it still use “enter” hotkey.

can you try add “Break” into here?

image
@anh.nguyen

When to lastrow, it still go into condition true ( “enter” hotkey).

If into Else condition it mean oki

when its at last row, whats the value of idx!!! @anh.nguyen

For easy understanding, I send xml file only For Each Row read excel.
I think my way wrong

As an image, I want when loop to lastrow will not enter hotkey


Read Multiple XML - Copy.xaml (27.5 KB)

why do you need to do idx+2
can you change if condition to this?
cint(idx) < cint(rowCount)

1 Like

idx+2 because count lastrrow from 2 (1 header)
idx count from 0 (so I think need idx+2 for same.

After trying sometime, use cint(idx+2) >= cint(rowCount) correct. Thank @jack.chan

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