Returning to original view.

G

Gazz_85

Hi,

i have a table that logs issues. each issue is assigned a number, however
the numbers also contain a letter such as R1,R2,M1,M2,ect.

I have written some macros to filter and sort the issues for various
reports. However i want to be able to turn the table to its original state.
how would i do this???

i have tried to sort the data in asscending order, but it puts it in
alphabetical order.

for example:

the original list is

R1
R2
M1
C1
M2
R3

I want the data to return to this not

C1
M1
M2
R1
R2
R3

Any help?????
 
J

JLatham

You need a helper column that simply contains a series of sequence numbers
that represent the original entry order. You could write a short macro
attached to the worksheet's _Change() event that would get the current
maximum value in that helper column, and if the cell in the helper column on
the row with the change is empty, then put the next sequence number into the
helper column. Code might look something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
'add next sequence number to column A when
'a change takes place in a single cell
'on the sheet below row 1
'and not in column A
If Target.Column <> 1 And Target.Row > 1 And _
Target.Cells.Count = 1 Then
If IsEmpty(Range("A" & Target.Row)) Then
Range("A" & Target.Row) = _
Application.WorksheetFunction.Max(Range("A:A")) + 1
End If
End If
End Sub
 
S

Stefi

One way is to use a helper column: before sorting fill it with =ROW(), Copy
and PasteSpecial>Values in the same column to save original row Nos, and sort
by helper column to return to the original order!

Regards,
Stefi

„Gazz_85†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top