|
Sub 合并整列單元格() Dim i As Integer Application.DisplayAlerts = False ' w = InputBox("請輸入 數(shù)字列號(比如1,2,3代表列數(shù))") For i = Cells(Rows.Count, Val(w)).End(xlUp).Row To 2 Step -1 If Cells(i, Val(w)).Value = Cells(i, Val(w))(0, 1).Value Then Cells(i, Val(w))(0, 1).Resize(2, 1).Merge End If Next Application.DisplayAlerts = True End Sub |
|
|