2、生成筛选序列
源代码
Sub jichuxulieQH16100901()
Dim ax1, ax2 As Long
Dim xulie1 As String
ax1 = Sheets("权限表").Range("i65536").End(xlUp).Row
With Sheets("查询表").Range("b1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=权限表!I2:I" & ax1 & " "
End With
With Sheets("结算利润表").Range("a1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=权限表!I2:I" & ax1 & " "
End With
With Sheets("上数利润表").Range("a1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=权限表!I2:I" & ax1 & " "
End With
End Sub
Sub jichuxulieQH16100902()
Dim ax3, ax4 As Long
Dim xulie2 As String
ax3 = Sheets("权限表").Range("j65536").End(xlUp).Row
For ax4 = 2 To ax3
xulie2 = xulie2 & Sheets("权限表").Cells(ax4, 10) & ","
Next
With Sheets("查询表").Range("d1").Validation
.Delete
.Add Type:=xlValidateList, Formula1:=xulie2
End With
End Sub

浙公网安备 33010602011771号