# How to use Table to assign values to variables in a list?

I'm trying to do the following:

R = {a, b, c, d, e, f, g, h, i};
Table[R[[n]] = RandomInteger[{0, 20}], {n, 1, Length[R]}]


My intention is to assign a random value to each of these variables. But somehow it's not working. What else do I need to do? I've tried to do:

ToExpression[R[[n]] = RandomInteger[{0, 30}]]


And:

Evaluate[R[[n]] = RandomInteger[{0, 30}]]

• Hello Gustavo, you'll want to avoid assigning things to capital letters. That being said, try Scan[(# = RandomInteger[{0, 30}]) &, R]. – J. M.'s ennui May 24 '15 at 22:45

Edit 11/15: Jerry Guern pointed out the need to be careful with quoting to have it work repeatedly. Here, I use Unevaluated to quote each variable:
r = Unevaluated /@ {a, b, c, d, e, f, g, h, i};

Now, you may use r repeatedly as input to:
MapThread[Set, {r, RandomInteger[{0, 20}, Length[r]]}];