stapuff
06-04-2004, 12:33 PM
After sorting the negative numbers to the top -this code loops through the sheet to the last row of negative numbers then send it to the printer. Works great, but I want to change it to select the negative number range rather than print it so I can copy and paste to another sheet.
Any help?
Thanks,
Kurt
Sheets("inventory").Select
Range("A2:D650").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("D2") _
, Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
Range("c65536").End(xlUp).Select
While ActiveCell >= 0
ActiveCell.Offset(-1, 0).Select
Wend
LastRow = ActiveCell.Row
ActiveSheet.PageSetup.PrintArea = "$a$2:$d$" & LastRow
'Application.ActivePrinter = "\\EARTH\Prodlaser (file://\EARTHProdlaser) on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\EARTH\Prodlaser (file://\EARTHProdlaser) on Ne02:", Collate:=True
Any help?
Thanks,
Kurt
Sheets("inventory").Select
Range("A2:D650").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("D2") _
, Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
Range("c65536").End(xlUp).Select
While ActiveCell >= 0
ActiveCell.Offset(-1, 0).Select
Wend
LastRow = ActiveCell.Row
ActiveSheet.PageSetup.PrintArea = "$a$2:$d$" & LastRow
'Application.ActivePrinter = "\\EARTH\Prodlaser (file://\EARTHProdlaser) on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\EARTH\Prodlaser (file://\EARTHProdlaser) on Ne02:", Collate:=True