Excel VBA Interior.ColorIndex 色彩列表

Sub a()
    Range(
"A1").Select

    
For i = 0 To 56 Step 1
        ActiveCell.Interior.ColorIndex 
= i
        ActiveCell.Offset(
01).Value2 = i
        
If i Mod 19 = 18 And i <> 0 Then
            ActiveCell.Offset(
-182).Select
        
Else
            ActiveCell.Offset(
10).Select
        
End If
    
Next
    
End Sub

 

 

结果如下

 

无色 0   19   38
  1   20   39
白色 2   21   40
  3   22   41
  4   23   42
  5   24   43
  6   25   44
  7   26   45
  8   27   46
  9   28   47
  10   29   48
  11   30   49
  12   31   50
  13   32   51
  14   33   52
  15   34   53
  16   35   54
  17   36   55
  18   37   56
posted @ 2011-08-10 17:53  #i小龙#  阅读(662)  评论(0编辑  收藏  举报