Hello and thanks in advance for any help.

I am trying to to put something together that will search through column AA:AA and if it finds a specific flag(Ex: "1") it will delete all rows under it until it hits another flag(Ex:"2"). I would want this to loop all the way through the sheet which does not have a defined amount of rows each time. Basically any data after a 1 should be removed and any data after a 2 should be kept in tact. Is there a way to set this up and also loop through the entire colum?