|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 整理数据()
Dim m%
m = [a65536].End(3).Row - 1
arr = Range("a2:a" & m + 1)
ReDim arr1(1 To m, 1 To 1)
For i = 1 To m
If Mid(arr(i, 1), 4, 1) = 1 Then
arr1(i, 1) = "单"
End If
If Mid(arr(i, 1), 4, 1) = 2 Then
arr1(i, 1) = "双"
End If
If Mid(arr(i, 1), 4, 1) = 3 Then
arr1(i, 1) = "三"
End If
If Mid(arr(i, 1), 3, 1) = "C" Then
arr1(i, 1) = "无机石"
End If
If Mid(arr(i, 1), 3, 1) = "Y" Then
arr1(i, 1) = "石英"
End If
For j = 4 To Len(arr(i, 1))
If Mid(arr(i, 1), j, 1) = "Y" Or Mid(arr(i, 1), j, 1) = "S" Then
arr1(i, 1) = "元素"
End If
If Mid(arr(i, 1), j, 1) = "A" Or Mid(arr(i, 1), j, 1) = "B" Then
arr1(i, 1) = "特"
End If
Next
Next
[b2].Resize(m, 1) = arr1
End Sub
|
评分
-
1
查看全部评分
-
|