range name each array(or column) .lt us assume A1 is having a haeding and the data starts from A2 down
then insert-name-denfine
name the range as for e.g. array1(1 is useful because you can increment it in your macro ).
in the refers to window type
=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1)
similarly array2 for column B data etc.
these are called dynamic range names and if you add or reduce the rows the range name will refer to expanded column
These naming ranges you do in the macro itself
for columns colatality create a variable in the macro e.g. j for the number of the last column e,.g
dim j as integer
j=range("a2").end(xltoright).column
so you can loop the correlations 1 to j
ultimately the correlation in vba will be something like this
range("H1").fomrula="=correl(array1,array2)"
will give the correlation between column A(1) and column B(2)
you have to have loops.
these are some of the ideas you can work on.


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks