| 
    
     |  | お世話になります。 
 マクロの勉強中ですので、よろしくお願いします。
 入力したデータをチェックするために、V,W,X列の2行目〜最終行までのそれぞれのセルの値によって、該当行色の塗りつぶしを表示させたくて、以下のマクロを
 組みました(自動記録式)。
 動作については、問題がないですが、範囲の「最終行」はどうするのか?わかりません。最終行の定義はA列連続のデータですので、一番下の行は最終行とします。
 
 Sub test001()
 ↓最終行
 Range("B2:U4").Select
 Selection.FormatConditions.Delete
 Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
 "=AND($V2<>""--"",$W2<>""--"",$X2<>""--"")"
 Selection.FormatConditions(1).Interior.ColorIndex = 15
 Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
 "=AND($V2<>""--"",$W2=""--"",$X2=""--"")"
 Selection.FormatConditions(2).Interior.ColorIndex = 45
 Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
 "=AND($V2<>""--"",$W2<>""--"",$X2=""--"")"
 Selection.FormatConditions(3).Interior.ColorIndex = 3
 End Sub
 
 |  |