View Single Post
Old 02-01-2013, 11:30
FaneDuru FaneDuru is offline
Join Date: May 2012
Posts: 35

Firstly, in order to generate random numbers between 1 and 'tot' you must use the next line:
R = Int((tot) * Rnd + 1)
Rnd returns a value less than 1 but greater than or equal to zero.
'To produce random integers in a given range, use this formula:
Int((upperbound - lowerbound + 1) * Rnd + lowerbound) - where, upperbound is the highest number in the range, and lowerbound is the lowest number in the range.'

Secondly, 'Color' is a class - an object and must be referenced using 'Set'. To nominate a shape inside a shapeRange you must use 'sr.Shapes(n)'... The line for color definition must be:
Set c = sr.Shapes(n).Fill.UniformColor ' looping shapes color
Set d = sr.Shapes(R).Fill.UniformColor ' random shapes color
I hope this helps...
Reply With Quote