0
我需要連接2列中的行,僅用於唯一標識。 Jeeped幫我下面的代碼級聯非空值vba
Option Explicit
Sub qwewreq()
Dim rw As Long
With Worksheets("Sheet3")
For rw = .Cells(.Rows.Count, "A").End(xlUp).Row - 1 To 2 Step -1
If .Cells(rw, "A").Value2 = .Cells(rw + 1, "A").Value2 Then
.Cells(rw, "B") = .Cells(rw, "B").Value2 &Chr(10) & .Cells(rw + 1, "B").Value2
.Cells(rw, "C") = .Cells(rw, "C").Value2 &Chr(10) & .Cells(rw + 1, "C").Value2
.Rows(rw + 1).EntireRow.Delete
End If
Next rw
End With
End Sub
我想盡一切非空值後添加一個符號。以上代碼在每個單元格後添加符號。是否可能以某種方式修改此代碼,以便Chr(10)只能在非空之後添加?
謝謝!這有幫助!