LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default correlation addin to macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO TO LOAD AN ADDIN FARAZ QURESHI Excel Discussion (Misc queries) 2 May 8th 09 09:26 AM
Is there an addin for displaying correlation matrices as contour p Chrissy Wissy[_2_] Charts and Charting in Excel 2 July 10th 07 01:24 PM
correlation James is Emusic Excel Worksheet Functions 1 April 25th 07 03:18 PM
Correlation matrix Peppino Excel Worksheet Functions 1 March 10th 05 01:32 PM
correlation function in macro Sam Excel Programming 0 July 29th 03 09:38 AM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"