Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2015, 01:38 AM
macropod's Avatar
macropod macropod is online now Merging Rows - HELP please! Windows 7 64bit Merging Rows - HELP please! Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


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
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm. Although the instructions are for Word, the Excel procedure is basically the same. Do note that macros can't be saved in xlsx files - you can run them in an xlsx file, however. If you want to keep the macro in the file for future use, save the file in the xls or xlsm format - or add the macro to your personal.xlsm workbook (see http://www.rondebruin.nl/win/personal.htm).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
join, merge, rows



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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft