Я хотел бы объединить количество дней, которые составляют до 80%. Пожалуйста, смотрите пример ниже:

Я могу запустить код, который объединяет диапазон A1: A7 и результат печатается в C1;
Sub Concatenator()
Dim lastLng As Long
Dim result As String
Dim delim As String
Dim b As String
delim = "&"
lastLng = Worksheets("Sheet1").Range("A1048576").End(xlUp).Row
For i = 1 To lastLng
b = Cells(i, 1).Value
result = result & b & delim
Next
result = Left(result, Len(result) - Len(delim))
Worksheets("Sheet1").Cells(1, 3).Value = result
End Sub
Я бы добавил «До» l oop, который повторяется до тех пор, пока значение в столбце не станет больше 80%. Я попытался изменить код выше с помощью цикла «До»;
Sub Concatenator()
Dim lastLng As Long
Dim result As String
Dim delim As String
Dim b As String
delim = "&"
lastLng = Worksheets("Sheet1").Range("A1048576").End(xlUp).Row
Do Until Cells(i, 2).Value = ">80%"
For i = 1 To lastLng1
b = Cells(i, 1).Value
result = result & b & delim
Next
Loop
result = Left(result, Len(result) - Len(delim))
Worksheets("Sheet1").Cells(1, 3).Value = result
End Sub