try this see if it helps ActiveCell.FormulaR1C1 = "=CORREL("$B$2":"$B$15",R[-14]C:R[-1]C)"
On Wed, Jan 26, 2011 at 2:11 AM, Fred <jonathanepos...@gmail.com> wrote: > I am trying to run a simple script the calculates the correlation > between column B and the column C, then does the same thing for column > B and column D, and then column B and column E, etc. I can't figure > out how to keep the first column (i.e. column B) constant, while > moving reference to the second column. Line 6 below seems to be the > problem. > > 1 Range("F16").Select > 2 ActiveCell.FormulaR1C1 = > "=CORREL(R[-14]C[-4]:R[-1]C[-4],R[-14]C:R[-1]C)" > 3 ActiveCell.Offset(0, 1).Select > 4 ActiveCell.FormulaR1C1 = > "=CORREL(R[-14]C[-5]:R[-1]C[-5],R[-14]C:R[-1]C)" > 5 ActiveCell.Offset(0, 1).Select > 6 ActiveCell.FormulaR1C1 = "=CORREL("B2":"B15",R[-14]C:R[-1]C)" > > > > Any suggestions?? > > Thanks > > -- > > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- *Regards* * * *Ashish Koul* *akoul*.*blogspot*.com <http://akoul.blogspot.com/> *akoul*.wordpress.com <http://akoul.wordpress.com/> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> P Before printing, think about the environment. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel