View Single Post
 
Old 01-14-2015, 11:04 PM
Raza Raza is offline Windows 7 32bit Office 2013
Novice
 
Join Date: Jan 2015
Location: Pakistan
Posts: 14
Raza is on a distinguished road
Default

Code:
Private Sub CommandButton21_Click()
Dim marks As Range
Dim bFail As Boolean
Dim n As Integer
    Set marks = Range(Cells(1, 2), Cells(4, 2))
    For n = 1 To marks.Rows.Count
        If marks.Cells(n, 2) < 50 Then
            bFail = True
            Exit For
        End If
    Next n
    If bFail Then
        Range("B6") = "Fail"
    Else
        Range("B6") = "Pass"
    End If
End Sub
Hi GMayor!!
I Tried this one for Range B1 to B4 but Failed!!
Reply With Quote