Hi,
I am trying to write a VBA for merging cells if Column A contains text and the next 2 columns are blank then select that row from column A to column H and merge but am having problems with selecting the correct range have highlighted my error in red.
Sub Merge()
For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row
If Not IsEmpty(Cells(i, 1)) And IsEmpty(Cells(i, 2)) And IsEmpty(Cells(i, 3)) Then
Range(A & i :, H & i).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Merge
End If
Next i
End Sub
Bookmarks