1 2 3 4 5 6 7 |
Sub test() For Each w In Sheets w.Cells.Validation.Delete Next End Sub |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Sub test() For Each w In Sheets If w.Name = "Sheet2" Then GoTo continue With w.Range("A2:A10").Validation .Delete .Add Type:=xlValidateList, Operator:=xlEqual, Formula1:="テスト1,テスト2" End With continue: Next End Sub |
1 2 3 4 5 6 7 8 9 10 11 12 |
Sub test() Set w = ActiveSheet w.Range("A2:K1000").Clear With w.Range("A2:A1000").Validation .Delete .Add Type:=xlValidateList, Operator:=xlEqual, Formula1:="=マスタ!$A$1:$A$776" End With End Sub |