I'd prefer:
NB. Put the code in the macromodule it belongs to: sheet1.Private Sub CommandButton1_Click() sn = Sheet2.Cells(1).CurrentRegion With Sheet1 .TextBox2 = "<MAR>" & .TextBox1 & "</MAR>" For j = 1 To UBound(sn) .TextBox2 = Replace(.TextBox2, sn(j, 1), sn(j, 2)) Next .TextBox2 = Replace(Replace(.TextBox2, "#", "; and #"), "; and #", "#", , 1) End With End Sub
Avoid worksheet interaction (reading / writing) as much as possible: use Arrays (like sn) to do this.