Dear 各位大大及版主您好 :
小弟有一函數轉換問題,請問在split(string," ")(0)後,如何將實為"000"轉換為數字"0"或"001"轉換為數字"1"呢?感恩!- Sub 巨集2()
- Dim MyTEXT As String, ar, j As Integer
-
- MyTEXT = "AAA:000 001 002 003"
- j = 1
- If MyTEXT Like AAA & "*" Then
- Cells(1, j).Value = Split(MyTEXT, ":")(0)
- ar = Split(Split(MyTEXT, ":")(1), " ")
- Cells(1, j + 1).Resize(, UBound(ar) + 1) = ar
- 'Result : Cells(1,1)=AAA , Cells(1,2)=000 , Cells(1,3)=001 , Cells(1,4)=002, Cells(1,5)=003
- '如何將000 001 002 003 轉換為數字Cells(1,2)=0 , Cells(1,3)=1 , Cells(1,4)=2, Cells(1,5)=3
- End If
- End Sub
複製代碼
2013-01-16 發問字串轉數字問題.zip (10.7 KB)
|