|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.5.20
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .Range("a4:a" & r - 1)
- For i = 1 To UBound(arr)
- st = CStr(arr(i, 1))
- result = ""
- For x = 1 To Len(st) Step 5
- result = result & Mid(st, x, 5) & vbCrLf
- Next
- arr(i, 1) = result
- Next
- .Range("a4:a" & r - 1) = arr
- End With
- End Sub
- Sub 数据恢复() '//2024.5.20
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .Range("a4:a" & r - 1)
- For i = 1 To UBound(arr)
- st = Split(arr(i, 1), Chr(10))
- result = ""
- For x = 0 To UBound(st)
- result = result & st(x)
- Next
- arr(i, 1) = result
- Next
- .Range("a4:a" & r - 1) = arr
- End With
- End Sub
复制代码
|
|