Microsoft Office Excel

注意点

データの入力規則の設定は、テーブル範囲で設定することができません。 列全体か、行全体かで設定してください。

使用例

下記のサンプルは、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


本当にほしかったのはこういうブログだったんだ

コメント:



(画像の文字列を入力して下さい)

トップ   編集 凍結 差分 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016/04/29 (金) 11:42:12 (2939d)

e[NȂECir Yahoo yV LINEf[^[Ōz500~`I
z[y[W ̃NWbgJ[h COiq@COsیI COze