Sub RecupPalette()
Set MaFeuille = ActiveWorkbook.Sheets.Add
OrdrePalette = Array(1, 53, 52, 51, 49, 11, 55, 56, 9, 46, 12, 10, 14, 5, 47, 16, 3, 45, 43, 50, 42, 41, 13, 48, 7, 44, 6, 4, 8, 33, 54, 15, 38, 40, 36, 35, 34, 37, 39, 2)
Cptr = 0
For i = 2 To 6
For j = 2 To 9
MaFeuille.Cells(i, j).Interior.ColorIndex = OrdrePalette(Cptr)
CoulRVB = MaFeuille.Cells(i, j).Interior.Color
Rouge = Int(CoulRVB Mod 256)
Vert = Int((CoulRVB Mod 65536) / 256)
Bleu = Int(CoulRVB / 65536)
MaFeuille.Cells(i, j) = "Index : " & OrdrePalette(Cptr) & Chr(10) & "RGB : " & Rouge & " - " & Vert & " - " & Bleu
Cptr = Cptr + 1
Next
Next
With MaFeuille.Range("B2:I6")
.ColumnWidth = 25
.RowHeight = 80
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Bold = True
.Name = "Verdana"
.Font.Size = 12
End With
MaFeuille.PageSetup.PrintArea = "$B$2:$I$6"
With MaFeuille.PageSetup
.LeftMargin = Application.InchesToPoints(0.21)
.RightMargin = Application.InchesToPoints(0.21)
.TopMargin = Application.InchesToPoints(0.21)
.BottomMargin = Application.InchesToPoints(0.21)
.HeaderMargin = Application.InchesToPoints(0.21)
.FooterMargin = Application.InchesToPoints(0.21)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub