|
- Sub heb()
- Call tianc
- Dim x, mrg As Range
- Application.DisplayAlerts = False
- Set mrg = [A1]
- For x = 2 To Range("a65536").End(xlUp).Row + 1
- If Cells(x, 1) = Cells(x - 1, 1) Then
- Set mrg = Union(mrg, Cells(x, 1))
- Else
- mrg.Merge
- Set mrg = Cells(x, 1)
- End If
- Next x
- Application.DisplayAlerts = True
-
- End Sub
- Sub tianc()
- Dim x As Integer
- Dim mrg As Range
- Set mrg = [A1]
- For x = 1 To Range("b65536").End(xlUp).Row - 1
- If Cells(x + 1, 1) = "" Then
- Set mrg = Cells(x, 1)
- Cells(x + 1, 1) = mrg
-
- Else
-
- Set mrg = Cells(x, 1)
- End If
- Next x
-
- End Sub
复制代码
|
评分
-
查看全部评分
|