can i set a set dynamic variable?

Arcticwarrio

Active Member
Joined
Dec 6, 2005
Messages
439
Hi all,

basically i want to set variables dec1 dec2 dec3 etc

something like
Code:
For i = 1 To 10
    dec & i = Range("C" & i + 7).Value
except this doesnt work

any ideas?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You would need to use an array variable

Code:
Dim dec(1 To 10) As Variant
For i = 1 To 10
    dec(i) = Range("C" & i + 7).Value
Next i
 
Upvote 0
is there a right or wrong way to clear them

eg will this cause problems i dont know about?

Code:
For i = 1 To 10     dec(i) = "" Next i
Cheers
Arctic.
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,144
Members
452,891
Latest member
JUSTOUTOFMYREACH

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