Sub RandomSelect() sCol = ColumnLetter(ActiveCell.Column) a = Application.Evaluate("=SUBTOTAL(3," & sCol & "3:" & sCol & "300)") If a = 0 Then MsgBox "No items between row 3 and 300" Exit Sub End If rn = Application.Evaluate("=randbetween(1," & a & ")") i = 0 Do While rn < 0 i = i + 1 If Rows(i).Hidden Or i < 3 Then Else rn = rn - 1 End If Loop Cells(i,ActiveCell.Column).Select End Sub