Board logo

標題: [分享] 合并单元格偏移求和 [打印本頁]

作者: wqfzqgk    時間: 2010-7-9 19:35     標題: 合并单元格偏移求和

Sub 合并单元格偏移求和()
Selection.ClearContents
Dim rng As Range
For Each rng In Selection
Set ma = rng.MergeArea
If ma.Address = rng.Address Then
rng.Value = rng.Offset(0, -2).Value
Else
ma.Cells(1, 1).Value = ma.Cells(1, 1).Value + rng.Offset(0, -2).Value
End If
Next
End Sub




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)