Привет, приведенный ниже код работает, но я продолжаю получать ошибку «Переполнение» в столбце даты. Даты должны прекратить производство в конце соседнего столбца (lastrow), однако по какой-то причине дата продолжает идти. Пожалуйста, не это только часть моего кода.
Sub TradeDump()
Dim ws As Worksheet
Dim wsp As Worksheet
Dim wsc As Worksheet
Dim i As Integer
Dim j As Integer
Dim rng As Range
Dim rnge As Range
Dim Rnger As Range
Dim ePlaceholder As Range
Dim dater As Date
Dim lastRow As Double
Dim counter As Integer
Dim howmanytrades As Integer
Dim lasthoora As Double
Dim Clearer As Range
Dim Clearer2 As Range
lastRow = ws.Cells(Rows.Count, "E").End(xlUp).Row
lasthoora = lastRow - 1
dater = wsc.Range("MonthE")
i = 1
counter = 2
howmanytrades = wsp.Range("G6", wsp.Range("G6").End(xlDown)).Rows.Count
Do Until i = lasthoora
For j = 1 To howmanytrades
If (j = lasthoora) Then Exit For
ws.Cells(counter, 4).Value = dater
counter = counter + 1
Next j
i = i + input1
dater = dater + 30
Loop
End Sub