|
- Private Sub CommandButton1_Click()
- Dim str$, st$, s$
- Dim k&, n&, p&, i&, r&
- str = "一二三四五六七八九十0123456789"
- For i = 2 To Range("A65536").End(xlUp).Row
- s = ""
- st = Cells(i, 1)
- n = Len(st)
- k = 1
- Do While k <= n
- p = InStr(str, Mid(st, k, 1))
- If p > 0 Then
- If p >= 11 Then p = p - 11
- If p < 7 Then p = p + 6
- s = Mid(str, p, 1)
- Exit Do
- End If
- k = k + 1
- Loop
- k = k + 1
- r = 0
- Do While k <= n
- p = InStr(str, Mid(st, k, 1))
- If p > 0 Then
- If p >= 11 Then p = p - 11
- If r = 0 Then
- r = p
- ElseIf r < 10 Then
- If p <> 10 Then
- r = r * 10 + p
- Else
- r = r * 10
- End If
- Else
- r = r + p
- End If
- End If
- k = k + 1
- Loop
- If r = 0 Then
- s = s & " (?) 班"
- Else
- s = s & " (" & r & ") 班"
- End If
- Cells(i, 2) = s
- Next
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|