tags:

views:

113

answers:

0

I have a spreadsheet with 2 tabs. Pension Log and Pension Log closed. On the Pension Log, I can sort by a number of fields.

This is the macro I have set up to run for the sort:

Sub Sort_Status()
'
' Sort_Name Macro
'
    ActiveSheet.Unprotect
    Range("A1:L3654").Select
    Selection.Sort Key1:=Range("j2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
    Range("A2").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
    , AllowSorting:=True
End Sub

Pension Closed Log is the same as the Pension log but just closed items.

Cell J2 is the status field. It is either an O, I, H or C (C for closed). I can sort this log so that all the closed are together.

What I want to do is via a manual process (button) sort and move all closed lines over to the Pension closed log and then clear contents on the row (but leave conditional formulas)on the pension log. Pension log is from Cell A2 to L3654.

the pension closed log would just keep adding (next blank row down) any closed items from the Pension log. This might be run once a month or so.

By setting this up, I want to be able to keep only active rows on the Pension Log and be able to automate the sort and copy/move the closed rows over to the Pension closed log. Presently users are using cut and paste causing format and conditional formatting problems.

thx

Mel