How do I merge cells that have data with blank cells in the same column?
<p>I'm in the middle of writing a macro for Excel that will merge cells in column "A" containing titles with blank cells beneath it.</p>

<p>Here is an example of what I'm dealing with:<a href="http://i.stack.imgur.com/MSzLx.png" rel="nofollow">Actual Before</a></p>

<p>Here is the desired result: <a href="http://i.stack.imgur.com/OQj0O.png" rel="nofollow">Actual After</a></p>

<p>So far I've managed to get my code to work, but I noticed that it will always skip over the "antivirus" section.</p>

<p>Here is what I got so far:</p>

<pre><code>    'loop to merge titles with blank cells and add borders
LR = Sheets(DataSheet).Cells(Rows.Count, "B").End(xlUp).Row
For i = 1 To LR
    If Sheets(DataSheet).Cells(i, 1).Value &lt;&gt; "" And Sheets(DataSheet).Cells(i + 1, 1).Value = "" And Sheets(DataSheet).Cells(i + 1, 2).Value &lt;&gt; "" Then
       u = i + 1
       Do While Sheets(DataSheet).Cells(u, 1).Value = "" And Sheets(DataSheet).Cells(u, 2) &lt;&gt; ""
            u = u + 1
        Loop
        Sheets(DataSheet).Range("A" &amp; i &amp; ":A" &amp; (u - 1)).Select
        With Selection
            .Merge
            .BorderAround Weight:=xlMedium
            .WrapText = True
            '.VerticalAlignment = x1VAlignTop
            '.HorizontalAlignment = xlLeft
        End With
        Sheets(DataSheet).Range("B" &amp; i &amp; ":B" &amp; (u - 1)).BorderAround Weight:=xlMedium
        i = u + 1
    End If
    If Sheets(DataSheet).Cells(i, 1).Value &lt;&gt; "" Then
        Sheets(DataSheet).Cells(i, 1).BorderAround Weight:=xlMedium
        Sheets(DataSheet).Cells(i, 1).WrapText = True
        Sheets(DataSheet).Cells(i, 2).BorderAround Weight:=xlMedium
        Sheets(DataSheet).Cells(i, 2).WrapText = True
    End If
Next i
</code></pre>

<p>Please excuse any sloppiness with my code, I'm very new at this. I don't know what I am missing, but any help would be greatly appreciated!
Thanks</p>