Sub Macro1()
'
' Macro1 Macro
'
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
Cells.Find(What:="country", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Copy
With Sheet3
.Range("B3:E3").Insert Shift:=xlDown
For i = 3 To .Cells(Rows.Count, 2).End(3).Row - 1
With .Range("B" & i & ":E" & i)
.HorizontalAlignment = xlCenter
.Merge
End With
Next
End With
MsgBox "Done"
' Sheets("Sheet3").Select
' Range("B3:E3").Select
' Selection.Insert Shift:=xlDown
' Selection.Columns.AutoFit
' Range("A1").Select
End Sub
1. I corrected your typo End(4) to End(3) which is why it was doing all the rows in the sheet and not just the used rows, that caused it to 'hang'!!!
2. I added the application items to speed up your code and stop the alerts.
3. I added - 1 to the row count line so that your 4 cells with text at the end doesn't get merged - it wasn't there in the original.
4. You may want to get rid of the formatting of the borders, I think it looks terrible!!
5. Avoid merged cells!!!!