| 
    
     |  | Cells(myRow, 5)に入力されている数字(1月から12月まで)によってセルの位置を変えて 背景色をつけたいので、以下のようなマクロを組みました。
 もうすこしすっきり書くことはできないでしょうか。
 
 Dim myRow As Integer
 With Cells(myRow, 5)
 Select Case .Value
 Case "1"
 Cells(myRow, 9).Interior.ColorIndex = 38
 Case "2"
 Cells(myRow, 10).Interior.ColorIndex = 38
 Case "3"
 Cells(myRow, 11).Interior.ColorIndex = 38
 Case "4"
 Cells(myRow, 12).Interior.ColorIndex = 38
 Case "5"
 Cells(myRow, 13).Interior.ColorIndex = 38
 Case "6"
 Cells(myRow, 14).Interior.ColorIndex = 38
 Case "7"
 Cells(myRow, 15).Interior.ColorIndex = 38
 Case "8"
 Cells(myRow, 16).Interior.ColorIndex = 38
 Case "9"
 Cells(myRow, 17).Interior.ColorIndex = 38
 Case "10"
 Cells(myRow, 18).Interior.ColorIndex = 38
 Case "11"
 Cells(myRow, 19).Interior.ColorIndex = 38
 Case "12"
 Cells(myRow, 20).Interior.ColorIndex = 38
 End Select
 
 どうぞよろしくお願いします。
 
 
 |  |