0
我需要將具有地址列設置的Excel數據庫設置爲: 「Physical Address,Mailing Address,Suit#; City; ST; Zip」分隔爲分號分隔的列。拆分地址列
不幸的是,我有地址列中有ASCII字符引用,不允許我只使用「文本到列」的數據,所以我開發了下面的代碼,但它並沒有做我想要的東西做。我是分割的範圍是B列
Sub SplitAddress()
Dim txt As String
Dim i As Integer
Dim j As Integer
Dim Address As Variant
Dim Rng As Range
Dim Row As Range
Dim LastRow As Integer
txt = ActiveCell.Value
Address = Split(txt, "; ")
LastRow = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
Rng = Range("B3:B" & LastRow)
j = 1
For Each Row In Rng.Rows
For i = 0 To UBound(Address)
Cells(3, j + 1).Value = Address(i)
Next i
Next Row
End Sub
我得到溢出錯誤... –
在其中line?..................... –
看到我的**編輯#1 **: –