The GetIndexOfColor property finds the specified color in the color palette. It returns the index number of the color in the palette. If the color is not found in the palette, it returns Nothing (0).
Examples:
The following VBA example finds the CMYK color cyan in the default palette and displays its index.
Sub Test()
Dim c As New Color
Dim idx As Long
c.CMYKAssign 100, 0, 0, 0
idx = ActivePalette.GetIndexOfColor(c)
MsgBox "Cyan color is at index " & idx
End Sub