标签:validate cells val nbsp count row sele select span
Private Sub Worksheet_Activate() Dim d As Object Dim arr Dim x As Integer Set d = CreateObject("scripting.dictionary") arr = Sheet1.Range("a2:a" & Sheet1.Cells(Rows.Count, 1).End(xlUp).Row) For x = 1 To UBound(arr) d(arr(x, 1)) = "" Next Sheets("Sheet2").Select Range("C2").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Join(d.keys, ",") ‘.Add 3, 1, 1, Join(d.keys, ",") End With End Sub
标签:validate cells val nbsp count row sele select span
原文地址:https://www.cnblogs.com/wangzj12/p/10115216.html