excel单元格合并的提速
With grid
For i = 0 To .Cols - 1
If .MergeCol(i) Then
curValue = data(.FixedRows, i)
lastRow = .FixedRows
For j = .FixedRows + 1 To .Rows - 1
If data(j, i) <> curValue Then
With xlSheet
.Range(.cells(lastRow + 1, i + 1), .cells(j, i + 1)).MergeCells = True
End With
curValue = data(j, i)
lastRow = j
End If
Next j
End If
Next i
End With
但是range.mergecells的方法速度实在是太慢了,有没有快的方法,一次性将一列数据按内容自动合并?