Sub RowMerge_Cell()

 Dim start_cell As String, end_cell As String
 Dim rTemp As Range, mTemp As Range
 
 
 On Error Resume Next
 Set rTemp = Application.InputBox("병합할 셀의 범위를 지정해주세요", "병합할범위", Type:=8)
 
 If rTemp Is Nothing Then
    MsgBox "범위 지정을 잘못되었습니다"
    Exit Sub
 End If

Application.DisplayAlerts = False

 
 start_cell = rTemp.Cells(1.1).Address

 For Each mTemp In rTemp
  If mTemp.Cells(1, 1).Value <> mTemp.Cells(2, 1).Value Then
     end_cell = mTemp.Cells(1, 1).Address
     Range(start_cell, end_cell).Merge
     Range(start_cell, end_cell).HorizontalAlignment = xlCenter
     start_cell = mTemp.Cells(2, 1).Address
  End If
 Next
 
 Application.DisplayAlerts = True
 
End Sub
