Major Member
|
我應該看完全文的...
我還以為真的要問excel...
結果真的在寫vba
Sub PCDVD()
r = [a65536].End(xlUp).Row
Db = Range(Cells(1, 1), Cells(r, 1))
a = 0
b = 0
For i = 1 To UBound(Db)
For j = 1 To 4
If j + b <= UBound(Db) Then
a = Db(j + b, 1)
Cells(j, i + 2) = Db(j + b, 1)
Select Case a
Case 1 To 4
Cells(j, i + 2).Interior.ColorIndex = 3
Cells(a, 1).Interior.ColorIndex = 3
Case 5 To 8
Cells(j, i + 2).Interior.ColorIndex = 4
Cells(a, 1).Interior.ColorIndex = 4
Case 9 To 12
Cells(j, i + 2).Interior.ColorIndex = 5
Cells(a, 1).Interior.ColorIndex = 5
Case 13 To 16
Cells(j, i + 2).Interior.ColorIndex = 6
Cells(a, 1).Interior.ColorIndex = 6
Case Else
Cells(j, i + 2).Interior.ColorIndex = 6 + i
Cells(a, 1).Interior.ColorIndex = 6 + i
End Select
End If
Next j
a = a + i
b = b + 4
Next i
End Sub
真的是認真就輸了...
我真的很傻...
|