Sub KeBawah_Button1_Click()
If Range("C3") = "" And Range("C4") = "" Then
Range("C3") = ActiveCell.Column + 1
Range("C4") = ActiveCell.Row + 1
Else
If ActiveCell.Column = 1 And ActiveCell.Row = 1 Then
Range("C3") = Range("C3") - 1
Range("C4") = Range("C4") - 1
Else
End If
End If
If ActiveCell.Column > 1 And ActiveCell.Row > 1 And ActiveCell.Column < Range("C3") And ActiveCell.Row < Range("C4") Then
ActiveCell.Offset(0, -1).Select
ActiveCell.Interior.ColorIndex = ActiveCell.Column
Else
If ActiveCell.Row > 1 And ActiveCell.Column < Range("C3") And ActiveCell.Row < Range("C4") Then
ActiveCell.Offset(-1, 0).Select
ActiveCell.Interior.ColorIndex = ActiveCell.Row
Else
If ActiveCell.Column < Range("C3").Value And ActiveCell.Row < Range("C4") Then
ActiveCell.Offset(0, 1).Select
ActiveCell.Interior.ColorIndex = ActiveCell.Column
Else
If ActiveCell.Row < Range("C4") Then
ActiveCell.Offset(1, 0).Select
ActiveCell.Interior.ColorIndex = ActiveCell.Row
Else
End If
End If
End If
End If
End Sub
=================
Hasilnya :
Tidak ada komentar:
Posting Komentar