Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sam
Dim cc, cr as Long cr = Row(lrhc) cc = WorksheetFunction.Correl(Range("F2:F" & cr), Range("G2:G & cr)) MsgBox cc -- sb "Sam" wrote in message om... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO TO LOAD AN ADDIN | Excel Discussion (Misc queries) | |||
Is there an addin for displaying correlation matrices as contour p | Charts and Charting in Excel | |||
correlation | Excel Worksheet Functions | |||
Correlation matrix | Excel Worksheet Functions | |||
correlation function in macro | Excel Programming |