Hi guys,
this is my first post here.
I've been searching for solutions in different threads and forums, and tried to apply them for 4 hours now. and still nothing.
I am very new to vba and macros, so bear with me.
i am trying to turn a list into a correlation matrix.
Goes like this :
From :
1 1 1
1 2 0.6
1 3 0.7
2 2 1
2 3 0.9
3 3 1
to
1 2 3
1 1 0.5 0.6
2 e 1 0.9
3 e e 1
the first list is from worksheet 1, and im trying to create the matrix in worksheet 2. Both worksheet is in the same open workbook.
here's the code i've been using
Sub button1_click()
Dim i As Integer
Dim j As Integer
Dim b As Integer
Dim a As Integer
Dim c As Integer
a = 0
i = 1
j = 1
c = 1
Do While b < 3656 <--- 3655 is the length of the list down
i = i + a
j = j + a
c = c + a
Do While c < 86 <---- matrix is 85 x 85
Worksheets(2).Cells(i, j).Value = Worksheets(2).Cells(b, 1).Value
b = b + 1
j = j + 1
c = c + 1
Loop
c = 1
i = 1
j = 1
a = a + 1
Loop
end sub
Now the weird thing is,
this worked on a smaller matrix before (31 x 31)
but now it just would't work at all (85 x 85)
it keeps giving me the error run time 1004 : application defined or object defined error.
here's the file :
matrix.xlsx
anyone please help?
thank you so very much
Bookmarks