![]() |
#8
|
||||
|
||||
![]()
Try the following macro:
Code:
Sub Demo() Dim lRow As Long, lCol As Long, i As Long, j As Long, SBar As Boolean With Application SBar = .DisplayStatusBar .DisplayStatusBar = True .ScreenUpdating = False .Calculation = xlManual End With With ThisWorkbook.Worksheets("AMI_2").UsedRange lRow = .Cells.SpecialCells(xlCellTypeLastCell).Row - 1 lCol = .Cells.SpecialCells(xlCellTypeLastCell).Column For i = lRow To 1 Step -1 Application.StatusBar = "Processing row " & i If .Cells(i, 2).Value = .Cells(i + 1, 2).Value Then For j = 3 To lCol If Len(Trim(.Cells(i, j).Value)) > 0 Then .Cells(i + 1, j).Value = .Cells(i, j).Text Exit For End If Next .Rows(i).EntireRow.Delete End If Next End With With Application .Calculation = xlAutomatic .StatusBar = False .DisplayStatusBar = SBar .ScreenUpdating = True End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
join, merge, rows |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
beginner | Excel Programming | 5 | 12-26-2014 12:29 AM |
![]() |
Bathroth | Word VBA | 1 | 10-01-2014 01:40 PM |
![]() |
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
![]() |
Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |
![]() |
gib65 | Excel | 2 | 12-09-2011 02:09 PM |