Sub RandomizeTest()
Dim questionsSheet As Worksheet
Dim testSheet As Worksheet
Dim rngQuestions As Range
Dim randomIndex As Integer
Dim i As Integer
Dim selectedQuestions(1 To 25) As String
Dim selectedCount As Integer
Dim question As String
Dim isDuplicate As Boolean
Set questionsSheet = ThisWorkbook.Sheets("Questions Sheet")
Set testSheet = ThisWorkbook.Sheets("Test Sheet")
testSheet.Range("A1:A25").ClearContents
Set rngQuestions = questionsSheet.Range("A1:A100")
Randomize
selectedCount = 0
Do While selectedCount < 25
randomIndex = Int((rngQuestions.Rows.Count * Rnd) + 1)
question = rngQuestions.Cells(randomIndex, 1).Value
isDuplicate = False
For i = 1 To selectedCount
If selectedQuestions(i) = question Then
isDuplicate = True
Exit For
End If
Next i
If Not isDuplicate Then
selectedCount = selectedCount + 1
selectedQuestions(selectedCount) = question
End If
Loop
testSheet.Range("A1:A25").Value = Application.Transpose(selectedQuestions)
End Sub