|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub test()
Dim arr, i, j, mark
On Error GoTo errmsg
mark = Split("【,】,(,),(,),〔,〕", ",") '要成对,中间加逗号(根据错误行提示进行添加)
arr = Range("e3:e" & Cells(Rows.Count, "e").End(xlUp).Row)
ReDim brr(1 To UBound(arr, 1), 1 To 1)
For i = 1 To UBound(arr, 1)
If InStr(arr(i, 1), "藏") Then
For j = 0 To UBound(mark)
arr(i, 1) = Replace(arr(i, 1), mark(j), IIf(j Mod 2 = 0, "[", "]"))
Next
brr(i, 1) = Split(Split(arr(i, 1), "[")(1), "]")(0)
End If
Next
[g3].Resize(UBound(brr, 1)) = brr
Exit Sub
errmsg:
MsgBox "检查行:" & i + 2
End Sub |
评分
-
1
查看全部评分
-
|