The range is unknown until it loops through a specified range A1:F20. Once a value is found while looping, add that range to the range variable.

thanks for looking.