View Single Post
 
Old 04-09-2013, 10:10 PM
Sajj Sajj is offline Windows 8 Office 2007
Novice
 
Join Date: Apr 2013
Posts: 3
Sajj is on a distinguished road
Default Filling cells with random numbers using loops? (VBA)

Hello,

I need to write a mcro that fills all the cells in the block range of cell with random numbers between 0 and 1.

so far I've done this:
Sub number()
Dim x As Double



For x = 1 To 10


Workbooks("book1").Sheets("Sheet1").Range("A1:f20" ).Offset(x, j).Value = Rnd()


Next
End Sub

the problem with my macro is having one random number on almost the entire determined range.
Reply With Quote