嘗試此作爲宏: 子mcrSplit_and_Insert() 昏暗我只要,R長,RWS長,c以範圍,VC爲變 對錯誤轉到下通 Application.EnableEvents =假 Application.ScreenUpdating =假
For r = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If InStr(1, Cells(r, 4).Value, ",") > 0 Then
rws = Len(Cells(r, 4).Value) - Len(Replace(Cells(r, 4).Value, ",", vbNullString))
Cells(r + 1, 4).Resize(rws, 1).EntireRow.Insert
Cells(r, 1).Resize(rws + 1, 9).FillDown
For i = 0 To rws
For Each c In Cells(r + i, 1).Resize(1, 9)
If InStr(1, c.Value, ",") > 0 Then
vC = Split(c.Value, ",")
c = vC(i)
End If
If IsNumeric(c) Then c = c.Value
Next c
Next i
End If
Next r
Columns(2).NumberFormat = "m/d/yy"
通電路: Application.ScreenUpdating =真 Application.EnableEvents =真 結束小組
http://stackoverflow.com/questions/8231368/split-strings-in-excel-vba – jswolf19 2013-05-14 15:08:01