你好, 我想用三階迴圈去指定一排儲存格的RGB顏色
程式如下,但是一直出現型態不符合,在後面打好多星星的那一行
可以請教問題在哪嗎?
=========================================
Sub assign_color()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim p As Integer
p = 3
For i = 0 To 255 Step 20
For j = 0 To 255 Step 20
For k = 0 To 255 Step 20
Range("A" & p).Value = p - 2
Range("B" & p).Value = i
Range("C" & p).Value = j
Range("D" & p).Value = k
Range("E" & p).Interior.Color = RGB(Cells("B", p).Value, Cells("C", p).Value, Cells("D", p).Value) **************
p = p + 1
Next
Next
Next
End Sub
=========================================作者: lpk187 時間: 2015-4-16 14:20