lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I got run time error 1004 running the code below. Tried everything but no luck. Any help would be appreciated. It is just to fill a cells with random number Thanks
Sub random1()
Dim i As Integer
Dim j As Integer
For i = 0 To 10
For j = 0 To 3
Workbooks(1).Worksheets(1).Cells(i, j).Value = WorksheetFunction.RandBetween(1, 1000)
Next j
Next i
End Sub
I got run time error 1004 running the code below. Tried everything but no luck. Any help would be appreciated. It is just to fill a cells with random number Thanks
Sub random1()
Dim i As Integer
Dim j As Integer
For i = 0 To 10
For j = 0 To 3
Workbooks(1).Worksheets(1).Cells(i, j).Value = WorksheetFunction.RandBetween(1, 1000)
Next j
Next i
End Sub