小白,照抄书上代码,运行错误,提示“子过程或函数未定义”求大神帮忙给看看谢谢!!
代码::
Function Breakdown(rng As Range, Optional style As Byte = 1) As String
Application.Volatile
On Error Resume Next
Dim i As Integer, str As String
str = Sp1it(rng.Text, ",")(WorksheetFunction.RoundUp(style / 3, 0) - 1)
If style Mod 3 = 1 Then
For i = 1 To Len(str)
If VBA.IsNumeric(Mid(str, i, 1)) Then Exit Function
Breakdown = Breakdown & Mid(str, i, 1)
Next i
ElseIf style Mod 3 = 2 Then
For i = 1 To Len(str)
If VBA.IsNumeric(Mid(str, i, 1)) Or Mid(str, i, 1) = "." Then Breakdown = Breakdown & Mid(str, i, 1)
Next
ElseIf style Mod 3 = 0 Then
For i = Len(str) To 1 Step -1
If VBA.IsNumeric(Mid(str, i, 1)) Then Exit Function
Breakdown = Mid(str, i, 1) & Breakdown
Next i
End If
If Err <> 0 Then Breakdown = ""
End Function
代码::
Function Breakdown(rng As Range, Optional style As Byte = 1) As String
Application.Volatile
On Error Resume Next
Dim i As Integer, str As String
str = Sp1it(rng.Text, ",")(WorksheetFunction.RoundUp(style / 3, 0) - 1)
If style Mod 3 = 1 Then
For i = 1 To Len(str)
If VBA.IsNumeric(Mid(str, i, 1)) Then Exit Function
Breakdown = Breakdown & Mid(str, i, 1)
Next i
ElseIf style Mod 3 = 2 Then
For i = 1 To Len(str)
If VBA.IsNumeric(Mid(str, i, 1)) Or Mid(str, i, 1) = "." Then Breakdown = Breakdown & Mid(str, i, 1)
Next
ElseIf style Mod 3 = 0 Then
For i = Len(str) To 1 Step -1
If VBA.IsNumeric(Mid(str, i, 1)) Then Exit Function
Breakdown = Mid(str, i, 1) & Breakdown
Next i
End If
If Err <> 0 Then Breakdown = ""
End Function
解决方案 »
- vb怎么打开桌面上的快捷方式
- 关于VB 用 WebBrowser1 控件自动提交表单问题?
- 接上一问题延续,请victorycyz与roger_xiong进来解答。
- 初用vb,请教报表的生成方法。用带参数的sql来取出数据,单表查询。可不分页。求例子。
- 表不能访问!
- 急,为什么显示的是“#”号?
- 请问rtsp://movie1.qu-zhou.com/mountpoint1/xfy02.rm
- Sql2000升级成sql2008
- 可不可以在VB里调用ACCESS表象调用EXCEL一样容易
- vb6.0下怎么将text中内容生成为xml格式文件
- VB编程excel出问题,高手帮忙解答下,谢谢!
- 用VB6.0画圆形按钮。
str = VBA.Split(rng.Text, ",")(WorksheetFunction.RoundUp(style / 3, 0) - 1)修改后:
文件下载:
链接:https://pan.baidu.com/s/1H73wpt4f6ZQNwAA2Bj6avA
提取码:znkg