测试代码:- Function SplitStr(objStr,Char)
- SplitStr=Split(objStr,Char)
- End Function
-
- a1="5-10"
- a2="50-25"
-
- msgbox "a:" & a1 & vbcrlf & "b:" & SplitStr(a1,"-")(0) & vbcrlf & "c:" &SplitStr(a1,"-")(1)
- msgbox "a:" & a2 & vbcrlf & "b:" & SplitStr(a2,"-")(0) & vbcrlf & "c:" &SplitStr(a2,"-")(1)
复制代码
|