如果长度<10,则将单元格值复制到VBA上方的单元格值的最后一个string中

我已经导入一个文本文件到Excel中会发生什么是一些文本已经闯入下一行,即

ColumnA -------------- 1313 Disneyland Dr, Anaheim, CA 92802 , USA '<---Copy/Cut cell value into the last string above cell 1600 Amphitheatre Parkway Mountain View, CA 94043 United States '<---Copy/Cut cell value into the last string above cell 

所需的输出

 ColumnA -------------- 1313 Disneyland Dr, Anaheim, CA 92802, USA 1600 Amphitheatre Parkway Mountain View, CA 94043 United States 

我已经提出了这个代码,但我迷失在复制它的最后一个单元格的值

 Sub CutCopyValue() Dim Last As Long Dim i As Long Last = Cells(rows.Count, "A").End(xlUp).row For i = Last To 1 Step -1 If Len(Cells(i, "A").Value) < 10 Then Cells(i, "A").Copy // I got lost in the destination End If Next i End Sub 

每一个帮助表示赞赏!

你不会使用。 .Copy ,只需使用&连接string:

 Sub CutCopyValue() Dim LastRow As Long Dim i As Long Dim DatSheet As Worksheet Set DatSheet = ActiveSheet With DatSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = LastRow To 1 Step -1 If Len(.Cells(i, "A").Value) < 10 Then .Cells(i - 1, "A").Value = .Cells(i - 1, "A").Value & .Cells(i, "A").Value End If Next i End With 'DatSheet End Sub