Hi,
If you want to fill all the columns, then you below:
Formula:![]()
Sub Macro1()
Dim Number(10), i, j As Integer
Dim Lower(10), Upper(10) As Long
For i = 1 To 10
Number(i) = Cells(7, i * 2 - 1)
Lower(i) = Cells(5, i * 2 - 1)
Upper(i) = Cells(5, i * 2 - 1)
For j = 1 To Number(i)
Cells(11 + j, i * 2 - 1).Formula = "=RANDBETWEEN($A$5,$B$5)"
Cells(11 + j, i * 2 - 1).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
Next j
Next i
End Sub
Bookmarks