|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim m As Long
- m = Target.Row
- ' 对 E 列的下拉列表进行验证设置
- With Cells(m, 5).Validation
- .Delete
- .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
- xlBetween, Formula1:="=类型"
- .IgnoreBlank = True
- .InCellDropdown = True
- .InputTitle = ""
- .ErrorTitle = ""
- .InputMessage = ""
- .ErrorMessage = ""
- .IMEMode = xlIMEModeNoControl
- .ShowInput = True
- .ShowError = True
- End With
- ' 对 F 列的下拉列表进行验证设置
- With Cells(m, 6).Validation
- .Delete
- .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
- xlBetween, Formula1:="=INDIRECT(E" & m & ")"
- .IgnoreBlank = True
- .InCellDropdown = True
- .InputTitle = ""
- .ErrorTitle = ""
- .InputMessage = ""
- .ErrorMessage = ""
- .IMEMode = xlIMEModeNoControl
- .ShowInput = True
- .ShowError = True
- End With
- ' 对 G 列的下拉列表进行验证设置
- With Cells(m, 7).Validation
- .Delete
- .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
- xlBetween, Formula1:="=INDIRECT(F" & m & ")"
- .IgnoreBlank = True
- .InCellDropdown = True
- .InputTitle = ""
- .ErrorTitle = ""
- .InputMessage = ""
- .ErrorMessage = ""
- .IMEMode = xlIMEModeNoControl
- .ShowInput = True
- .ShowError = True
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|