sc123,
You state that you want it to run on selected text, not on a specific range. You need to select your range first then start to record your macro, Not start the recording and then select your range.
This one I selected the range first, then clicked reocrd
Sub merge()
'
' merge Macro
' Macro recorded 7/10/2004 by Mbarron
'
'
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.merge
End Sub
this one I clicked record first then selected the range.
Sub Merge2()
'
' Merge2 Macro
' Macro recorded 7/10/2004 by Mbarron
'
'
Range("E10:G10").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.merge
End Sub
Mike