Biyernes, Marso 14, 2014

How to make a CheckerBoard in Excel

Sub CheckerBoard( )
Dim Row as Integer , Col as Integer
For row = 1 to 8
If  WorkSheetFunction.isOdd(Row) Then
 For Col = 2 to 8 Step 2        'we used  Step 2 statement to make an alternate colored part in excel

 Cells(Row,Col).Interior.Color=90
 Next Col

Else
 For Col = 1 to 8 Step 2    
 Cells(Row,Col).Interior.Color=25
 Next Col
End If
Next Row
End Sub

Run the Program and the output is something like this: