Sub Concat()
Do While ActiveCell <> ""
'The rows are filtered to display only "London"
'The changes required are for "London" only
If ActiveCell.Offset(0,0) = "London" Then
ActiveCell.Offset(0, 0).FormulaR1C1 = _
ActiveCell.Offset(0, 0) & " " & ActiveCell.Offset(0, 1)
ActiveCell.Offset(0, 1) = ""
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub
我有接近13500行。 這不起作用。我看不到任何明顯的變化。Excel VBA腳本將兩個單元格內容連接成一個
我沒有寫任何。我不知道從哪裏開始。或如何。 – Selvam 2013-02-15 05:15:53
我試過了 - Sub ConcatColumns() Do While ActiveCell <>「」'循環直到活動單元格爲空。 'The「&」必須在兩邊都有空格,否則將被視爲長整數的可變類型「 」。 ActiveCell.Offset(0,1).FormulaR1C1 = _ ActiveCell.Offset(0,-1) 「」 &ActiveCell.Offset(0,0) ActiveCell.Offset(1,0)。選擇 環路 End Sub – Selvam 2013-02-15 06:18:30