I am trying to format and merge 4 cells within a macro as follows:
Range("E20:E23").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
Range("F20:F23").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
End Sub
The problem I have is that the range of cells are different each time (i.e. tommorrow the cells may be "E30:E33" & "F30:F33". In other words, I want the merge to occur in the cell active cell I have selected. So if my cursor is in the current cell of "B22" that is where I want the merge to begin.
Thank you in advance for any comments.
Bookmarks