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 **: –