Array built from array and declaration trouble

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
I would like to populate the array TempSample using PriceData. PriceData is currently defined using a worksheet table. How can I convert the current PriceData variant into something that will behave like a traditional array? If I ReDim PriceData(1 to A, 1 to 3) as Variant, where A is equal to UBound(PriceData,1) I receive an error down the code "unable to get the correl property of the worksheetfunction class". How can I define the first array starting from a table on a worksheet?

Code:
Dim PriceData As Variant:           PriceData = Worksheets(DataSht).Range(samplerange)
For rr = 1 To NumObs
        
        TempSample(rr, 1) = PriceData(ii + rr, 1) 
        TempSample(rr, 2) = PriceData(ii + rr, 2) 
        TempSample(rr, 3) = PriceData(ii + rr, 3)
    
    Next rr
 
Glad it's working & thanks for the feedback
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top