I have a range with rows with data from columns A to K. There is already blank row between every new change in cell value in column C. I want to merge the data in column c based off whether the values are the same PLUS one blank row below. I absolutely need the merge to include one blank row for each unique cell value in column B because i will be grouping values later.
The current code I have merges everything except for the last unique value...Could anyone help me adjust my code so that i can also include my last unique value?
Sub MergeSameValue()
Application.DisplayAlerts = False
Dim LastRow As Integer
Dim StartRow As Integer
StartRow = 12
LastRow = Range("B" & Rows.Count).End(xlUp).Row
Dim StartMerge As Integer
StartMerge = StartRow
For i = StartRow + 1 To LastRow + 1
If Cells(i, 2) <> "" Then
If Cells(i, 2) <> Cells(i - 1, 2) Then
Range(Cells(i - 1, 2), Cells(StartMerge, 2)).Merge
StartMerge = i
End If
End If
Next i
End Sub