Note that there are some explanatory texts on larger screens.

plurals
  1. POMerge cells and delete duplicate data
    text
    copied!<p>I have a list of companies and each has a scope of work, address and phone number. Some of the companies have multiple scopes of work. It looks something like this:</p> <p><img src="https://i.stack.imgur.com/OmkRZ.png" alt="SO20748873 question example"></p> <p>I want to get rid of the second copy of the stuff like the address (and in my case phone numbers and such) while copying the unique data in the second line and putting it in the first line and then getting rid of the second line. </p> <p>I have very little experience of coding. I looked up how to do this step by step but something is wrong within the code or the syntax: </p> <ol> <li>I found code for going down a column for a blank space.</li> <li>I looked up how I would copy a cell to the right of the active blank cell.</li> <li>I found code for merging the info into the cell one above and one to the right of the active cell.</li> <li>I found code that deletes the row with the active cell.</li> <li>I want it to loop until there are no more blank <code>company</code> cells.</li> </ol> <p>So this is how I put it together: </p> <pre><code>Public Sub SelectFirstBlankCell() Dim sourceCol As Integer, rowCount As Integer, currentRow As Integer Dim currentRowValue As String Do sourceCol = 6 'column F has a value of 6 rowCount = Cells(Rows.Count, sourceCol).End(xlUp).Row 'for every row, find the first blank cell and select it For currentRow = 1 To rowCount currentRowValue = Cells(currentRow, sourceCol).Value If IsEmpty(currentRowValue) Or currentRowValue = "" Then Cells(currentRow, sourceCol).Select End If Next Loop Until A647 End Sub </code></pre> <p>. </p> <pre><code>Sub mergeIt() Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(1, 1)).Merge ActiveCell.Select End Sub </code></pre> <p>. </p> <pre><code>Sub DeleteRow() RowNo = ActiveCell.Row If RowNo &lt; 7 Then Exit Sub Range("A" &amp; ActiveCell.Row).EntireRow.Delete Sheets("Summary").Select Range("A4:O4").Select Selection.Copy LastRow = Range("A65536").End(xlUp).Offset(1, 0).Row End Sub </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload