Hi,
You need understand and how to control loop with Data Flow Control Selenium IDE Commands 2021 - Overview and Tutorials
Try to learn it by writing some basic macros.
Example photo added: parameter xPa is assigned value 21. Then I use loop to increase by 1. Using while loop, the loop repeat untill value 30. First macro (1st photo), while loop with condition: ${xPa} <= 30. And 2nd macro, while loop with condition true: it means that the loop is forever, however, loop will be broken with Break command with control: If ${xPa} == 30 then break.
Then please refer Loop action to next elements in page - #3 by Minh_Hung
Pagination every 20 loops go next page searching good workaround