Macro to merge and format selected cell

  • Thread starter Thread starter Taylor
  • Start date Start date
T

Taylor

I want to create a macro that will merge the selected cell with the one next
to it (on the right) and format it to align left. When this macro runs, I
would like for it to perform the action in whichever cell is selected and not
the cells that are referenced while recording the macro. I hope this makes
sense!
 
Taylor,

How about:

Sub MergeCells()
With Selection
.Resize(1, 2).MergeCells = True
.Resize(1, 2).HorizontalAlignment = xlLeft
End With
End Sub

regards

Pete
 
Back
Top