Loop for date

Hello everyone!
There is a variable date_str = “10.05.2021” (date format dd.MM.yyyy), then this variable will be converted to date format date = CDate (date_str).
How do I create a while loop that will take one day at a time until it is equal to the current date? For example, 10.05.2021
** 09.05.2021**
** 08.05.2021**
** 07.05.2021 = current date, end of the cycle.**

In your while loop, use an if condition to check if date = CurrentDate, then use “Break” activity. When this activity is encountered, the robot stops iterating and immediately breaks out(goes out) of the loop. This activity works for all looping statements.

If you are using VB.net , then you should use the command “Exit While” inside your if condition

Thank you!

1 Like

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