- Excel VBA 質問スレ Part44 [無断転載禁止]©2ch.net
188 :デフォルトの名無しさん[sage]:2016/11/28(月) 23:25:03.69 ID:JmUquKRk - シンプルにしてみた
Sub CellColor() Dim Cell As Range For Each Cell In Selection If Cell.ColorIndex = 3 then Dec Cell Next End Sub Sub Dec(Cell As Range) Dim flg1 as boolean Dim flg2 as boolean If 1 < Cell.column then flg1 = (Cell(1,0).ColorIndex = 6) If Cell.Column < Columns.Count then flg2 = (Cell(1,2).ColorIndex = 6) If flg1 or flg2 Then Cell.ColorIndex = 43 End Sub
|
|