how to randomly select a row number from excel sheet? I am simulating lottery game. thx
Dim RandomRow As Long 'RandomRow = 'whatever code you'd use to pick a random number between 1 & 65536 Rows(RandomRow).EntireRow.Select
this works from in excel VB Code: Sub test() Dim RandomRow As Long Randomize RandomRow = Int((65536 * Rnd) + 1) Rows(RandomRow).EntireRow.Select End Sub
Sub test() Dim RandomRow As Long Randomize RandomRow = Int((65536 * Rnd) + 1) Rows(RandomRow).EntireRow.Select End Sub
Forum Rules