evo konacno malo vremena da se vratim ovom:
pokusala sam da reorganizujem svoj makro, ali opet mi se podaci vracaju na pocetak.
ja hocu da ucitava a2, b2, c2 ako je e2=bm, pa onda e3=bm da ucitava a3,b3,c3, ...
jel neko moze da ispravi gresku:
Citat:
Sub Download()
Dim LastRow As Long
Dim LastColumn As Long
Dim val As String, st As String, ed As String, ID As String
Dim Ofs As Long
ActiveSheet.Range("I:ZZ").ClearContents
LastRow = 2
st = 2
ed = 2
ID = 2
LastColumn = 1
While True
val = Cells(LastRow, 5).Value
st = Cells(LastRow, 1).Value
ed = Cells(LastRow, 2).Value
ID = Cells(LastRow, 3).Value
If val = "ind" Then
GetIndexzeitreihe Range("A2"), Range("B2"), Range("C2"), Range("I1").Offset(0, Ofs)
ElseIf val = "bm" Then
GetBenchmark Range("A2"), Range("B2"), Range("C2"), Range("I1").Offset(0, Ofs)
ElseIf val = "" Then
Exit Sub
End If
LastRow = LastRow + 1
'st = st + 1
'ed = ed + 1
'ID = ID + 1
LastColumn = LastColumn + 3
Ofs = Ofs + 3
Wend
End Sub