is this possible? same BL# will be merge at the same time Merge also the Balance PHP and SUM.
see attached sample
thanks
is this possible? same BL# will be merge at the same time Merge also the Balance PHP and SUM.
see attached sample
thanks
Last edited by ash3angel; 04-08-2015 at 01:13 AM.
try
Sub ertert() Dim i&, j&, Lr&, sm# Lr = Cells(Rows.Count, 1).End(xlUp).Row With Application .ScreenUpdating = False: .DisplayAlerts = False For i = 3 To Lr sm = Cells(i, 7): j = i Do While Cells(i, 1) = Cells(i + 1, 1) sm = sm + Cells(i + 1, 7) i = i + 1: If i > Lr Then Exit Do Loop If i > j Then Cells(j, 1).Resize(i - j + 1).Merge Cells(j, 7).Resize(i - j + 1).Merge Cells(j, 7).Value = sm End If Next i .ScreenUpdating = True: .DisplayAlerts = True End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks