问题:C列相同的,GH两列的内容横向排成一行
Sub Test() Dim MyRow As Long, MyCol As Long For MyRow = Cells(Rows.Count, 3).End(xlUp).Row To 2 Step -1 If Cells(MyRow, 3) = Cells(MyRow - 1, 3) Then MyCol = Cells(MyRow, Columns.Count).End(xlToLeft).Column - 6 Cells(MyRow - 1, 9).Resize(1, MyCol) = Cells(MyRow, 7).Resize(1, MyCol).Value Cells(MyRow, 3).EntireRow.Delete End If Next End Sub
标签:End,MyCol,重复,Cells,一行,Long,MyRow,对应,Sub From: https://www.cnblogs.com/officeplayer/p/17323714.html