Greetings,
Caution: this post is related to a previous post, but due to the previous post lacking all critical elements contributing to the conflict I am posting again with new material information, namely the collection component to the problem.
I am trying to define a range that incorporates variables taken from a collection as in the script below. I am thinking there may be conflict in the Range argument due to the fact that the variables used to define the ranges used in the Pearson arguments are being drawn from a collection. Could my Pearson arguments not make sense or be or an incorrect type?
Any ideas on troubleshooting this conflict would be much appreciated.
Caution: this post is related to a previous post, but due to the previous post lacking all critical elements contributing to the conflict I am posting again with new material information, namely the collection component to the problem.
I am trying to define a range that incorporates variables taken from a collection as in the script below. I am thinking there may be conflict in the Range argument due to the fact that the variables used to define the ranges used in the Pearson arguments are being drawn from a collection. Could my Pearson arguments not make sense or be or an incorrect type?
Code:
Dim ws As WorksheetDim za As Variant
Dim zb As Variant
Dim zc As Variant
Dim zz As Variant
Dim xx As Variant
Dim ww As Variant
Dim zj As Variant
Dim zh As Variant
Dim zi As Variant
Dim yy As Variant
Dim col As New Collection
Dim col2 As New Collection
col.Add "b"
col.Add "c"
col.Add "D"
col.Add "E"
col.Add "F"
col.Add "G"
col.Add "h"
col.Add "i"
col.Add "j"
col.Add "k"
col.Add "l"
col.Add "m"
col.Add "n"
col.Add "o"
col.Add "P"
col.Add "Q"
col.Add "R"
col.Add "S"
col.Add "T"
col.Add "U"
col.Add "V"
col.Add "W"
col.Add "x"
col.Add "y"
col.Add "z"
col.Add "AA"
col.Add "AB"
col.Add "AC"
col.Add "AD"
col.Add "AE"
col.Add "AF"
col.Add "AG"
col.Add "AH"
col.Add "AI"
col.Add "AJ"
col.Add "AK"
col.Add "AL"
col.Add "AM"
col.Add "AN"
col.Add "AO"
col.Add "AP"
col.Add "AQ"
col.Add "AR"
col.Add 45
col.Add "AT"
col.Add "AU"
col.Add "AV"
col.Add "AW"
col.Add "AX"
col.Add "AY"
col.Add "AZ"
col.Add "BA"
col.Add "BB"
col.Add "BC"
col.Add "BD"
col.Add "BE"
col2.Add "BF"
For Each ws In Workbooks("COMM_PA.xls").Worksheets
zz = ActiveSheet.Name
yy = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For Each xx In col
za = xx
For Each ww In col2
zb = ww
With Workbooks("COMM_PA.xls").Worksheets(zz)
zh = Application.WorksheetFunction.Pearson(.Range(.Cells(2, zb), .Cells(yy, zb)), .Range(.Cells(2, za), .Cells(yy, za)))
Any ideas on troubleshooting this conflict would be much appreciated.