Meatball
03-09-2009, 01:17 PM
I need this code altered to loop through all sheets after Sheet 2, the quantity of sheets will be ever changing. If any cleaning of the code can be done , that would be fine with me. I would also like to send each sheet to a recipient whose e-mail address would be in cell A1 of each sheet.
Sub SortForZeroFirst()'' SortForZeroFirst Macro' Macro recorded 3/9/2009 by David D'' Sheets(3).Activate Range("A5:I" _
& Range("B2000").End(xlUp).Row).Select Selection.Sort Key1:=Range("I5"), Order1:=xlAscending, Key2:=Range("C5") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Range("A1").Select Sheets(4).Activate Range("A5:I" & _
Range("B2000").End(xlUp).Row).Select Selection.Sort Key1:=Range("I5"), Order1:=xlAscending, Key2:=Range("C5") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Range("A1").Select
End Sub
Thanks in advance for any help.
Sub SortForZeroFirst()'' SortForZeroFirst Macro' Macro recorded 3/9/2009 by David D'' Sheets(3).Activate Range("A5:I" _
& Range("B2000").End(xlUp).Row).Select Selection.Sort Key1:=Range("I5"), Order1:=xlAscending, Key2:=Range("C5") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Range("A1").Select Sheets(4).Activate Range("A5:I" & _
Range("B2000").End(xlUp).Row).Select Selection.Sort Key1:=Range("I5"), Order1:=xlAscending, Key2:=Range("C5") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Range("A1").Select
End Sub
Thanks in advance for any help.