Sorry I don't follow what you are trying to do
Ratings1(1, 5) = Ratings(1,5).
Providing each array is sized to accommodate (1,5), and Ratings1 can accept
similar data type to that in Ratings(1,5), the above will work
Regards,
Peter T
<snip>
quoted text -
- Show quoted text -
thanks for all your help. Here is my full code where ratings gets set.
I actually want the first element of Ratings1 to somehow lookup and
return a new value that is a little different to what was in the old
Ratings array. But that is a seperate issue, for now i just would like
the basic structure to work. Here is the full code where Ratings is
derived and rw is set:
Public Sub Ratings()
Dim cell As Variant
Dim x, y As Integer
Dim Ratings(), rTicker(), Ratings1() As String
Dim AsDte As Date
Dim iLastRow, i As Long
AsDte = InputBox("What Is the As-of-day?")
Workbooks.Open Filename:= _
"M:\CBO's\Surveillance\TEMPLATES\MKP Rating Tracker\MKP Rating
Tracker V2.xls" _
, UpdateLinks:=0, Notify:=False, ReadOnly:=True
Sheets("All Actions").Activate
i = 3368
While (Sheets("All Actions").Cells(i, 9) <> "")
If (UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO1" Or
UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO2" _
Or UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO3" Or
UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO4" _
Or UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO5" Or
UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO6" _
Or UCase(Trim(Sheets("All Actions").Cells(i, 1))) = "CBO7") _
And UCase(Trim(Sheets("All Actions").Cells(i, 9))) > AsDte Then
ReDim Preserve Ratings(6, rw)
Ratings(0, rw) = Sheets("All Actions").Cells(i, 2).Value
Ratings(1, rw) = Sheets("All Actions").Cells(i,
3).Value
Ratings(2, rw) = Sheets("All
Actions").Cells(i, 7).Value
Ratings(3, rw) = Sheets("All Actions").Cells(i,
8).Value
Ratings(4, rw) = Sheets("All Actions").Cells(i, 9).Value
Ratings(5, rw) = Sheets("All Actions").Cells(i, 10).Value
rw = rw + 1
End If
i = i + 1
Wend
Workbooks.Open Filename:="M:\CBO's\Collateral Attributes\MKP CBO
Collateral Attributes.xls" _
, UpdateLinks:=0, Notify:=False, ReadOnly:=True
Sheets("Portfolio").Activate
For Each cell In Ratings
ReDim Preserve Ratings1(6, rw)
Ratings1(0, rw) = Application.VLookup(cell.Value,
Sheets("Portfolio").Range("EK4:EL1200"), 2, False)
Ratings1(1, rw) = Ratings(1, rw)
Ratings1(2, rw) = Ratings(2, rw)
Ratings1(3, rw) = Ratings(3, rw)
Ratings1(4, rw) = Ratings(4, rw)
Ratings1(5, rw) = Ratings(5, rw)
rw = rw - 1
Next cell
Windows("RATINGSupdate.xls").Activate
x = 4
For y = 0 To rw - 1
Cells(x, 1).Value = Ratings1(0, y)
Cells(x, 2).Value = Ratings1(1, y)
Cells(x, 3).Value = Ratings1(2, y)
Cells(x, 4).Value = Ratings1(3, y)
Cells(x, 5).Value = Ratings1(4, y)
Cells(x, 6).Value = Ratings1(5, y)
x = x + 1
Next
End Sub
Thanks, preciate it