- ©«¤l
- 227
- ¥DÃD
- 3
- ºëµØ
- 1
- ¿n¤À
- 273
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-3-22
- ³Ì«áµn¿ý
- 2013-1-29
|
cÄ椣¯à¯Ç¤J´`Àô¤¤¾Þ§@- Sub test()
- Dim c%, n%, i%, r%
- Application.DisplayAlerts = False
- n = [a65536].End(xlUp).Row
- For c = 1 To 2
- r = 2
- For i = 2 To n
- If Cells(i, c) <> Cells(i + 1, c) Then
- If r < i Then Range(Cells(r, c), Cells(i, c)).Merge
- r = i + 1
- End If
- Next
- Next
- For r = 2 To n
- If Cells(r, 2).MergeCells Then
- a = Cells(r, 2).MergeArea.Address
- s = Split(a, "$")
- For k = Val(s(2)) To Val(s(4))
- Do While Cells(k, 3).Offset(j, 0) = Cells(k, 3) And k + j <= Val(s(4))
- j = j + 1
- Loop
- If j > 1 Then
- Cells(k, 3).Resize(j).Merge
- k = k + j - 1
- j = 1
- End If
- Next
- r = k - 1
- End If
- Next
- End Sub
½Æ»s¥N½X |
|