Nevermind, I figured it out.
Dim p As Decimal = 0
For Each row As GridViewRow In GridView1.Rows
Dim quantlabel As Label = DirectCast(row.FindControl("quantlabel"), Label)
Dim extlabel As Label = DirectCast(row.FindControl("extlabel"), Label)
If quantlabel.Visible = True Then
Dim q As Decimal = extlabel.Text
p = p + q
Else
End If
Next