Monday, November 22, 2010

Excel VBA 01

Picking cells

http://www.excel-vba-easy.com/vba-programming-excel-vba-loop.html

Sub Macro1()
Dim total As Integer
total = 0
For i = 1 To 8
For j = 1 To 2
If Cells(i, j).Value > 60 Then total = total + 1
Next j
Next i

MsgBox total & "values higher than 60"
End Sub

No comments:

Post a Comment