Thread: randomize
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter Atherton[_3_] Peter Atherton[_3_] is offline
external usenet poster
 
Posts: 11
Default randomize

Hi

I Think this might be what you want
Sub Test()
Dim tot As Double, c As Variant
i = 3
randomize
For j = 2 To 7
c = Int(Cells(i + 1, j) - Cells(i, j) + 1 * Rnd + Cells
(i, j))
tot = tot + c
Next
Range("H2").Value = tot
End Sub



regards
Peter



-----Original Message-----
Sub randomize()
Range("H2") = Int((Range("B4") - Range("B3") + 1) * Rnd +

Range("B3"))

End Sub

I want to randomize from more than "B4 - B3".

"B4 - B3" and "C4 - C3" and "D4 - D3" and "E4 - E3"

and get the rnd result in "H2"


---
Message posted from
http://www.ExcelForum.com/

.