Error using While loop. Assign: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

@Khadija_Zeb,

That’s right your while loop will start with i=0 then it will increment to 1 and then 2 that’s it.

Kindly close the thread if it’s clear by marking my answer as solution.

Thanks,
Ashok :slight_smile: