Home > Software engineering >  Small white, copy the code book, runtime error, suggesting "sub procedure or function undefined
Small white, copy the code book, runtime error, suggesting "sub procedure or function undefined

Time:09-15

Small white, copy the code book, runtime error, suggesting "sub procedure or function undefined" beg god for help to see thank you!!



Code: :
The Function Breakdown (RNG As Range, Optional style As Byte=1) As String
Application. The Volatile
On the Error Resume Next
Dim I As an Integer, STR As String
STR=Sp1it (RNG) Text, ", ") (WorksheetFunction. RoundUp (style/3, 0) - 1)
If style Mod and 3=1 Then
For I=1 To Len (STR)
If VBA. IsNumeric (Mid (STR, I, 1)), Then the Exit Function
Breakdown=Breakdown & amp; 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 & amp; Mid (STR, I, 1)
Next
ElseIf style Mod 3=0 Then
For I=Len (STR) To Step 1-1
If VBA. IsNumeric (Mid (STR, I, 1)), Then the Exit Function
Breakdown=Mid (STR, I, 1) & amp; Breakdown
Next I

End the If
If Err & lt;>
0 Then Breakdown=""End the Function

CodePudding user response:

Line 5 increase "VBA.", is changed to:
 STR=VBA. The Split (RNG) Text, ", ") (WorksheetFunction. RoundUp (style/3, 0) - 1) 


Revised:


File download:
Link: https://pan.baidu.com/s/1H73wpt4f6ZQNwAA2Bj6avA
The extracted code: ZNKG

CodePudding user response:

CodePudding user response:

The function name to write wrong not Sp1it is among the Split is not the number 1, is the letter L
  • Related