Answer the question
In order to leave comments, you need to log in
8x8 0 and 1 implementation in excel?
It is necessary that in the active cell in excel with access a board is created from checks at 0 and 1.
where zero is gray / it is necessary to color it with code
. I only got the board itself and I don’t know how to do the other.
Thanks in advance for your help
Here is my code just to create an 8x8 board 0 and 1
Sub osmXosm()
For i = 1 To 8
If i Mod 2 <> 0 Then
For j = 1 To 8
If j Mod 2 <> 0 Then
Cells(j, i) = 1
Else
Cells(i, j) = 0
End If
Next j
Else
For k = 1 To 8
If k Mod 2 = 0 Then
Cells(k, i) = 1
Else
Cells(i, k) = 0
End If
Next k
End If
Next i
End Sub
Answer the question
In order to leave comments, you need to log in
You have an 8x7 field in the example.
The code does not shine with beauty, but it works on any field size. The size is created by changing the variables lim_row and lim_col.
Sub sd()
cur_row = ActiveCell.row
cur_col = ActiveCell.Column
cur_value = 1
lim_row = 11
lim_col = 11
For i = cur_row To cur_row + lim_row
For j = cur_col To cur_col + lim_col
If i = cur_row Then
If cur_value = 0 Then cur_value = 1 Else cur_value = 0
Else: If cur_value = Cells(i - 1, j).value Then If cur_value = 0 Then cur_value = 1 Else cur_value = 0
End If
Cells(i, j).value = cur_value
Next j
Next i
End Sub
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question