-11
Sub Seperate_Item_Codes_and_Descriptions()
'Seperate the item codes and the descriptions and put them in respectively in columns D and E.
Dim s As Long, a As Long, aVALs As Variant
With Worksheets(1)
aVALs = .Range(.Cells(12, "B"), .Cells(.Rows.Count, "B").End(xlUp)).Value2
ReDim Preserve aVALs(LBound(aVALs, 1) To UBound(aVALs, 1), 1 To 2)
For a = LBound(aVALs, 1) To UBound(aVALs, 1)
s = InStr(1, aVALs(a, 1), Chr(32))
aVALs(a, 2) = Mid(aVALs(a, 1), s + 1)
aVALs(a, 1) = Left(aVALs(a, 1), s - 1)
Next a
.Cells(12, "D").Resize(UBound(aVALs, 1), UBound(aVALs, 2)) = aVALs
End With
End Sub
至於你'sub'註解中提到的'獨立的項目代碼和描述,並把它們分別列d和E'。 – Smartis