Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel vba.Interior.ColorIndex不';我不能正常工作_Vba_Excel - Fatal编程技术网

Excel vba.Interior.ColorIndex不';我不能正常工作

Excel vba.Interior.ColorIndex不';我不能正常工作,vba,excel,Vba,Excel,我有两个细胞:绿色和紫色。我有密码: Sub test() With Selection.Interior MsgBox (.ColorIndex) End With End Sub 为什么带有数字15的MsgBox同时显示绿色和紫色。 当我使用代码时 Sub test() With Selection.Interior MsgBox (.Color) End With End Sub 它给出了不同的数字,但对于绿色和紫色是唯

我有两个细胞:绿色和紫色。我有密码:

Sub test()
    With Selection.Interior
        MsgBox (.ColorIndex)
   End With   
End Sub
为什么带有数字
15的
MsgBox
同时显示绿色和紫色。 当我使用代码时

Sub test()
    With Selection.Interior
        MsgBox (.Color)
   End With
End Sub
它给出了不同的数字,但对于绿色和紫色是唯一的:
10213316
13082801

为什么
ColorIndex
给出相同的数字,为什么
Color
给出不同且唯一的数字


在代码中使用
.Color
返回的数字是否安全?它会随着计算机的不同而变化吗?

.Color
是比
.ColorIndex
更宽的调色板(它定义了更多的颜色)。ColorIndex必须近似以弥补较少定义的颜色和颜色的阴影


仅供参考。
周围的颜色是多余的,最终会咬到你的屁股。