![]() |
|
#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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Delete blank rows between the two rows that contain data
|
beginner | Excel Programming | 5 | 12-26-2014 12:29 AM |
Delete All empty Rows - Print - Undo all Rows deleted
|
Bathroth | Word VBA | 1 | 10-01-2014 01:40 PM |
Grouping table rows to prevent individual rows from breaking across pages
|
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
Count rows and add blank rows accordingly
|
Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |
merging rows and creating sub-rows
|
gib65 | Excel | 2 | 12-09-2011 02:09 PM |