Hi All,
I'm having a bit of trouble populating an array in Excel. Here is the code I have tried and I get a 'subscript out of range error. Any thoughts?
For k = 1 To topValues
Top5Countries(k) = Worksheets(worksheetName).Cells(4 + k, countryColumn)
Next k
For l = 1 To topValues
Top5Values(l) = objbook.Worksheets(worksheetName).Cells(4 + l, dataColumn)
Next l
Thanks alot!
I'm having a bit of trouble populating an array in Excel. Here is the code I have tried and I get a 'subscript out of range error. Any thoughts?
For k = 1 To topValues
Top5Countries(k) = Worksheets(worksheetName).Cells(4 + k, countryColumn)
Next k
For l = 1 To topValues
Top5Values(l) = objbook.Worksheets(worksheetName).Cells(4 + l, dataColumn)
Next l
Thanks alot!