软件:excel
版本:2007
我有一个表
A x
A x
A y
B y
B x
C k
C k
C x
D x
D x
D y
想要储存格合并的时候
B字段依照A字段合并
现在的宏会变成B字段的就合并一起
档案如附件:
https://drive.google.com/open?id=1HC3AC-tunGI2MTeLfxkEtE_f0dcT0ZeL
我用宏如下
Dim xR As Range, xH As Range
For Each xR In Range([A1], [A65536].End(xlUp))
If xR <> xR(0) Then Set xH = xR
If xR <> xR(2) Then Range(xR, xH).Merge
Next
For Each xR In Range([b1], [b65536].End(xlUp))
If xR <> xR(0) Then Set xH = xR
If xR <> xR(2) Then Range(xR, xH).Merge
Next
不知道这块要怎么改