ColorIndex | 1 | 53 | 52 | 51 | 49 | 11 | 55 | 56 |
RGB | 000000 | 993300 | 333300 | 003300 | 003366 | 000080 | 333399 | 333333 |
RGB(10進) | 0,0,0 | 153,51,0 | 51,51,0 | 0,51,0 | 0,51,102 | 0,0,128 | 51,51,153 | 51,51,51 |
UserForm色 | &h000000 | &h003399 | &h003333 | &h003300 | &h663300 | &h800000 | &h993333 | &h333333 |
ColorIndex | 9 | 46 | 12 | 10 | 14 | 5 | 47 | 16 |
RGB | 800000 | FF6600 | 808000 | 008000 | 008080 | 0000FF | 666699 | 808080 |
RGB(10進) | 128,0,0 | 255,102,0 | 128,128,0 | 0,128,0 | 0,128,128 | 0,0,255 | 102,102,153 | 128,128,128 |
UserForm色 | &h000080 | &h0066FF | &h008080 | &h008000 | &h808000 | &hFF0000 | &h996666 | &h808080 |
ColorIndex | 3 | 45 | 43 | 50 | 42 | 41 | 13 | 48 |
RGB | FF0000 | FF9900 | 99CC00 | 339966 | 33CCCC | 3366FF | 800080 | 969696 |
RGB(10進) | 255,0,0 | 255,153,0 | 153,204,0 | 51,153,102 | 51,204,204 | 51,102,255 | 128,0,128 | 150,150,150 |
UserForm色 | &h0000FF | &h0099FF | &h00CC99 | &h669933 | &hCCCC33 | &hFF6633 | &h800080 | &h969696 |
ColorIndex | 7 | 44 | 6 | 4 | 8 | 33 | 54 | 15 |
RGB | FF00FF | FFCC00 | FFFF00 | 00FF00 | 00FFFF | 00CCFF | 993366 | C0C0C0 |
RGB(10進) | 255,0,255 | 255,204,0 | 255,255,0 | 0,255,0 | 0,255,255 | 0,204,255 | 153,51,102 | 192,192,192 |
UserForm色 | &hFF00FF | &h00CCFF | &h00FFFF | &h00FF00 | &hFFFF00 | &hFFCC00 | &h663399 | &hC0C0C0 |
ColorIndex | 38 | 40 | 36 | 35 | 34 | 37 | 39 | 2 |
RGB | FF99CC | FFCC99 | FFFF99 | CCFFCC | CCFFFF | 99CCFF | CC99FF | FFFFFF |
RGB(10進) | 255,153,204 | 255,204,153 | 255,255,153 | 204,255,204 | 204,255,255 | 153,204,255 | 204,153,255 | 255,255,255 |
UserForm色 | &hCC99FF | &h99CCFF | &h99FFFF | &hCCFFCC | &hFFFFCC | &hFFCC99 | &hFF99CC | &hFFFFFF |
ColorIndex | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
RGB | 9999FF | 993366 | FFFFCC | CCFFFF | 660066 | FF8080 | 0066CC | CCCCFF |
RGB(10進) | 153,153,255 | 153,51,102 | 255,255,204 | 204,255,255 | 102,0,102 | 255,128,128 | 0,102,204 | 204,204,255 |
UserForm色 | &hFF9999 | &h663399 | &hCCFFFF | &hFFFFCC | &h660066 | &h8080FF | &hCC6600 | &hFFCCCC |
ColorIndex | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
RGB | 000080 | FF00FF | FFFF00 | 00FFFF | 800080 | 800000 | 008080 | 0000FF |
RGB(10進) | 0,0,128 | 255,0,255 | 255,255,0 | 0,255,255 | 128,0,128 | 128,0,0 | 0,128,128 | 0,0,255 |
UserForm色 | &h800000 | &hFF00FF | &h00FFFF | &hFFFF00 | &h800080 | &h000080 | &h808000 | &hFF0000 |
カラー定数 | vbBlack | vbRed | vbGreen | vbYellow | vbBlue | vbMagenta | vbCyan | vbWhite |
ColorIndex | 1 | 3 | 4 | 6 | 5 | 7 | 8 | 2 |
参考 | 黒 | 赤 | 緑 | 黄 | 青 | マゼンタ | シアン | 白 |
Dim colh As String Dim colhd As String Dim col10 As String Sub カラー1() Dim mydat() As Variant Dim i As Integer, r As Integer, c As Integer, ra As Integer, kk As String mydat = Array(Array(1, 53, 52, 51, 49, 11, 55, 56), _ Array(9, 46, 12, 10, 14, 5, 47, 16), Array(3, 45, 43, 50, 42, 41, 13, 48), _ Array(7, 44, 6, 4, 8, 33, 54, 15), Array(38, 40, 36, 35, 34, 37, 39, 2)) ra = 2 For i = 1 To 2 For r = 0 To 4 For c = 0 To 7 If i = 1 And c = 0 Then Cells(ra, 2).Value = "" Cells(ra + 1, 2).Value = "ColorIndex" Cells(ra + 2, 2).Value = "RGB" Cells(ra + 3, 2).Value = "RGB(10進)" Cells(ra + 4, 2).Value = "UserForm色" End If If i = 1 Then Cells(ra, c + 3).Interior.ColorIndex = mydat(r)(c) Cells(ra + 1, c + 3) = mydat(r)(c) Else kk = Cells(r * 5 + 2, c + 3).Interior.Color Call 色RGB(kk) Cells(ra, c + 3) = colh Cells(ra + 1, c + 3) = col10 Cells(ra + 2, c + 3) = colhd End If Next c ra = ra + 5 Next r Set myrang = Range(Cells(2, 2), Cells(ra - 3, c + 2)) With myrang .NumberFormat = "@" .Font.Size = 10 .Borders.LineStyle = xlContinuous End With ra = 4 Next i End Sub ------------------------------------------------------------ Sub 色RGB(col) Dim col1 As String Dim col1a As String, col2a As String, col3a As String col1 = "00000" & Hex(col) col1a = Mid(Right(col1, 6), 1, 2) col2a = Mid(Right(col1, 6), 3, 2) col3a = Mid(Right(col1, 6), 5, 2) colh = col3a & col2a & col1a colhd = "&h" & col1a & col2a & col3a 色十進数 col10 = CDec("&h" & col3a) & "," & CDec("&h" & col2a) & _ "," & CDec("&h" & col1a) End Sub |
Sub カラー2() Cells(2, 2).Interior.ColorIndex = 39 Cells(3, 2).Interior.Color = RGB(&HCC, &H99, &HFF) Cells(4, 2).Interior.Color = RGB(204, 153, 255) End Sub ----------------------------------------------------------- Sub カラー2a() Range("B2:B4").Interior.ColorIndex = xlNone Range("B1").Select End Sub |
Sub カラー3() With UserForm1 .txt1.BackColor = "&H42049c": .txt6.BackColor = "&H521c00" .txt2.BackColor = "&H6304e7": .txt7.BackColor = "&H732400" .txt3.BackColor = "&Hb586ff": .txt8.BackColor = "&Hff751d" .txt4.BackColor = "&Hceaeff": .txt9.BackColor = "&Hff9e1f" .txt5.BackColor = "&He7d7ff": .txt10.BackColor = "&Hffcfb5" End With Cells(1, 1).Interior.Color = RGB(&H9C, &H4, &H42) Cells(1, 2).Interior.Color = RGB(&HE7, &H4, &H63) Cells(1, 3).Interior.Color = RGB(&HFF, &H86, &HB5) Cells(1, 4).Interior.Color = RGB(&HFF, &HAE, &HCE) Cells(1, 5).Interior.Color = RGB(&HFF, &HD7, &HE7) Cells(2, 1).Interior.Color = RGB(&H0, &H1C, &H52) Cells(2, 2).Interior.Color = RGB(&H0, &H24, &H73) Cells(2, 3).Interior.Color = RGB(&H1D, &H75, &HFF) Cells(2, 4).Interior.Color = RGB(&H1F, &H9E, &HFF) Cells(2, 5).Interior.Color = RGB(&HB5, &HCF, &HFF) UserForm1.Show End Sub |