I have a macro that will replace a alphanumeric code, with a corrisponding name that is on sheet4. This use to be two macros. now that I have combined them, the macro will only pick up a few lines. what i need is a way to tell the macro to sort everything on column A, and then run the Macro.
Sub uic()
Dim subs
Set subs = Sheet4
Set r = subs.Range("B2:" & subs.Range("C2").End(xlDown).Address)
For i = 1 To r.Rows.Count
Sheet2.Range("M2:" & Sheet1.Range("M2").End(xlDown).Address).Select
Selection.Replace What:=r.Cells(i, 1), Replacement:=r.Cells(i, 2), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next
End Sub
Sub uic()
Dim subs
Set subs = Sheet4
Set r = subs.Range("B2:" & subs.Range("C2").End(xlDown).Address)
For i = 1 To r.Rows.Count
Sheet2.Range("M2:" & Sheet1.Range("M2").End(xlDown).Address).Select
Selection.Replace What:=r.Cells(i, 1), Replacement:=r.Cells(i, 2), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next
End Sub