I am completely new to programming here.
I am getting a subscript out of range error on the following code:
b(i) = ThisWorkbook.Sheets("trades").Range("AA & arxi +i-1:AD& arxi+i-1").Value
I believe it has to do with the syntax, or maybe because I haven't redimed b(vdomada,4) ?
In any case the data from the range do not go into the array. The result would be to input the data in the array and then export them in a different excel file(the exporting bit is not into the code provided)
Thanks in advance for your help.
Sub report()
Dim b As Variant, arxi As Integer, telos As Variant
Dim LastDayRow As Integer, vdomada As Integer, i As Integer, z As Integer
Dim LastDay As Date
Application.Workbooks("Back Office 2019.xlsx").Activate
Sheets("trades").Select
LastDayRow = Range("L" & Rows.Count).End(xlUp).Row
telos = Cells(LastDayRow, 12)
arxi = InputBox("Please enter the row for the start of the week")
vdomada = LastDayRow - arxi
ReDim b(vdomada) As Variant
For i = 1 To vdomada
b(i) = ThisWorkbook.Sheets("trades").Range("AA & arxi +i-1:AD& arxi+i-1").Value
Next i
End Sub
b(i) = ThisWorkbook.Sheets("UST trades").Range("AA" & arxi + i - 1 & ":AD" & arxi + i - 1).Value