|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub Test()
- Dim shSource As Worksheet
- Dim lngRows As Long, lngRowID As Long, lngR As Long
- Dim arr As Variant
- Dim strTemp As String, strSplit() As String
- Dim strResult As String
-
- Set shSource = Sheets("Sheet2")
-
- lngRows = shSource.Range("C" & Rows.Count).End(xlUp).Row
- If lngRows < 2 Then lngRows = 2
-
- arr = shSource.Range("A1:C" & lngRows)
-
- For lngRowID = UBound(arr) To LBound(arr) Step -1
- strTemp = arr(lngRowID, 3)
- strSplit = Split(strTemp, "*")
- strResult = ""
-
- If UBound(strSplit) > 0 Then
- For lngR = 1 To UBound(strSplit)
- If IsNumeric(strSplit(lngR)) Then
- strResult = strResult & "---" & "第" & Val(strSplit(lngR)) & "件"
- Else
- strResult = strResult & "---" & "第" & Asc(strSplit(lngR)) - 64 & "面"
- End If
- Next
- strResult = Mid(strResult, 4)
-
- shSource.Rows(lngRowID).Insert Shift:=xlDown
- shSource.Range("A" & lngRowID).Value = strResult
- End If
- Next
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|