Restoring Natural Order

  • Thread starter Thread starter Paul Bruneau
  • Start date Start date
P

Paul Bruneau

Hi Folks,

I have a large table, and will often mess around with it by sorting in different
orders.

What I want to be able to do is restore the file, after screwing around, back to
its natural order, the order in which the records were entered..... no index
order, no special sort orders.

Can I do that?

Can I "Impose" a numeric increment column, that wouldn't resort itself if I
resort the data? The file is huge, so i wouldn't want to insert line numbers by
hand.

Thanks

Paul
 
I'm not quite sure I understand. I assume that when you sort you maintain
the entire row as it was when entered. Then, you can sort the rows by any
column desired and then resort by the original date, name or whatever. I
have a database for a POA that has some strange lot numbers such as
30
30A
31
32-33

That when sorted by name might look like this
30A
22
20
38-1/3 39

So, there is a hidden numeric column 10 and I use a doubleclick event to
sort
right click on sheet tab>view code>insert this

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)
If ActiveCell.Column = 1 Then
mycol = 10
Else
mycol = ActiveCell.Column
End If
[sortrange].Sort Key1:=Cells(1, mycol), Order1:=xlAscending,
Orientation:=xlTopToBottom
end sub
 
Why don't you work on a copy instead, open the workbook and do a save as
then you
leave the original alone?
 
Paul

Line numbers do not have to be entered by hand.

In a column adjacent to your data enter a 1 in row 1(or 2 if you have
headers).

Right-click and drag down as far as you need.

Release mouse button and select "Fill Series".

Gord Dibben Excel MVP
 
Back
Top