Quantcast
Channel: OKWAVE 最新質問(Visual Basic/257)【本日】
Viewing all articles
Browse latest Browse all 7264

Excel VBA Interior.Color

$
0
0
困っています。よろしくお願いします。 以下のマクロで、 値として「薄緑」(13172680)を入力したのに、その値が勝手に変わってしまいます。 13434828になってってしまいます。そのため、「色消し」が働きません。 また、colorとして「白」(16777215)を設定した場合と、colorindexとしてxlnoneを入力した場合、excelの表上での見た目が違います。なぜでしょうか。また、colorに何を入力するとcolorindexにxlnoneを入力したのと同じになるのでしょうか。 Option Explicit Public Const 薄緑 As Long = 13172680 '200,255,200 Public Const 白 As Long = 16777215 'rgb(255,255,255) Sub 色付け()  Cells(1, 1).Interior.Color = 薄緑 End Sub Sub 色消し()    If Cells(1, 1).Interior.Color = 薄緑 Then    Cells(1, 1).Interior.Color = 白    End If End Sub Sub test()    Cells(1, 1).Interior.ColorIndex = xlNone End Sub Sub test1()    Cells(1, 1).Interior.Color = 白 End Sub Sub test2()    MsgBox Cells(1, 1).Interior.Color End Sub

Viewing all articles
Browse latest Browse all 7264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>