i have the foll. macro which captures a column of data - as my data length
changes frequently the below macro does that ....
now i can capture 2 colums of data with that macro by changing column name..
now what i wana do is that ...
calculate the correlation coeff using correl function ...
can anyone tell me how to add that bit to my existing macro ...
below is the macro ......
--------------------------
Sub select_datastrategy()
Range("f1:f500").Select
Selection.ClearContents
Dim ulhc As String 'upper left hand corner
Dim lrhc As String 'lower right hand corner
Dim wdth As Integer 'true width in columns
ulhc = "$b$2"
wdth = 1
Application.Goto Range(ulhc) 'goto upper left hand corner
ActiveCell.Offset(0, wdth - 1).Select 'move to edge of data (column)
lrhc = Selection.End(xlDown).Address 'get address of lrhc
Range(ulhc & ":" & lrhc).Select
Selection.Copy
Sheets("sheet1").Select
Range("$f$2").Select
'ActiveCell.Select
Selection.PasteSpecial Paste:=xlValues, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
-----------------
assume next column of data in column G ....
thanks
sam
changes frequently the below macro does that ....
now i can capture 2 colums of data with that macro by changing column name..
now what i wana do is that ...
calculate the correlation coeff using correl function ...
can anyone tell me how to add that bit to my existing macro ...
below is the macro ......
--------------------------
Sub select_datastrategy()
Range("f1:f500").Select
Selection.ClearContents
Dim ulhc As String 'upper left hand corner
Dim lrhc As String 'lower right hand corner
Dim wdth As Integer 'true width in columns
ulhc = "$b$2"
wdth = 1
Application.Goto Range(ulhc) 'goto upper left hand corner
ActiveCell.Offset(0, wdth - 1).Select 'move to edge of data (column)
lrhc = Selection.End(xlDown).Address 'get address of lrhc
Range(ulhc & ":" & lrhc).Select
Selection.Copy
Sheets("sheet1").Select
Range("$f$2").Select
'ActiveCell.Select
Selection.PasteSpecial Paste:=xlValues, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
-----------------
assume next column of data in column G ....
thanks
sam