Storing values as array/matrix in VBA loop

joejackson123

New Member
Joined
Oct 27, 2017
Messages
16
Hi all, I have the following code

HTML:
Sub sensitivity()
Dim a1, a2 As DoubleDim i As StringDim offerarray() As VariantDim arraycount As Long
a1 = Range("low").Valuea2 = Range("hi").Value

For i = a1 To a2 Step 0.001
Range("disc").Value = a1 + i
offerarray(i) = Range("propoffer").Value
Next i
End Sub

propoffer, disc low, and hi are all named cells within my spreadsheet. I can't figure out how to store the value from "propoffer" in each step of the loop in an array (which I then later want to post to another sheet). Any help is much appreciated, thank you!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,216,024
Messages
6,128,333
Members
449,443
Latest member
Chrissy_M

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