I have an Excel macro that sorts data from various workbooks, compliling it into a single cumulative workbook. The following series of commands (and other similar ones) is repeated throughout the macro:
Selection.AutoFilter Field:=10, Criteria1:="G"
Selection.AutoFilter Field:=21, Criteria1:="=D", Operator:=xlOr, _
Criteria2:="=S" 'dismissed or suspended
Set UpperLeftCorner = Sheets("schonfeld_012507").Range("A1")
RowCount = -1
For Each area In _
RowCount = RowCount + area.Rows.Count
It just seems inefficient to see those same lines repeated over an over throughout the macro. Is there a way to assign a "shortcut" to the series and just insert the shortcut instead? If so it would shorten the entire macro by several hundred lines. Thanks.