Sub sosu() Dim i As Long Dim j As Long Dim m As Long Dim p As Long i = 1 j = 1 p = 2 Do If hantei(p) Then Cells(i, j) = p i = i + 1 If i > Rows.Count Then i = 1 j = j + 1 End If End If p = p + 1 If i = 96 Then Exit Sub End If Loop End Sub Function hantei(ByVal p As Long) As Boolean hantei = False Dim m As Long For m = 2 To Int(Sqr(p)) If p Mod m = 0 Then Exit Function End If Next hantei = True End Function