注意点 †データの入力規則の設定は、テーブル範囲で設定することができません。 列全体か、行全体かで設定してください。 使用例 †下記のサンプルは、B列の1~60のセルをリスト形式で設定する、リストで設定できるデータの範囲はD列の1~10までのセルの値となります。 Range(Cells(1, 2), Cells(60, 2)).Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=" & Cells(1, 4).Address & ":" & Cells(10, 4).Address .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .IMEMode = xlIMEModeNoControl .ShowInput = True .ShowError = True End With 固定値の利用 †Range(Cells(1, 2), Cells(60, 2)).Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="○,×" ...省略... End With 本当にほしかったのはこういうブログだったんだ コメント: |