乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>Excel</em> <em>VBA</em>中如何设置<

<em>Excel</em> <em>VBA</em>中如何设置<

作者:乔山办公网日期:

返回目录:excel表格制作


    With [b1].Validation '生成数据有效性下拉菜单 【b1】为指定单元格
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:=x ’x为有效性菜单格式为:A,B,C,D
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .IMEMode = xlIMEModeNoControl
        .ShowInput = True
        .ShowError = True
    End With


with Columns("D:D").Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=or(d1=0,and(d1>=150,d1<=550))"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With
建立多级下拉菜单:学一下就会
http://hi.baidu.com/sykamuni/album/item/5813e6117c658adfc2ce7950.html?isnew=1#IMG=73769c6cfee57bd8431694b8

Range("H4").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="1,2"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With
Range("I7").Select
按上面修改zd

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网