|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
wbk = Mid(TextBox1.Text, dhwz + 1, dhwz2) '文本框中的数去除逗号后分别循环筛选
If ecxh = 0 Then arr = Filter(R, wbk, True) Else arr = Filter(arr, wbk, True) '这里进行循环筛选
Next
- For j = 0 To UBound(arr)
- sr2 = Split(arr(j), "#")
- n = UBound(sr2)
- sr3 = arr(j)
- For i = 2 To n - 1
- sr3 = WorksheetFunction.Substitute(sr3, "#", "", 2)
- Next
- arr(j) = sr3
- Next
复制代码
arr1 = Join(arr) '将筛选出的数组连接,以便通过正则表达式替换出只有行号的值
With CreateObject("VBScript.RegExp") '‘正则表达式将#----#替换掉,就只有如“1:1,3:3”这样的行号
.Global = -1
.Pattern = "#.*?#"
arr1 = .Replace(arr1, ",")
End With
在arr1前面加这段代码。 |
|