ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Returning to original view. (https://www.excelbanter.com/excel-discussion-misc-queries/236048-returning-original-view.html)

Gazz_85[_2_]

Returning to original view.
 
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?????

JLatham

Returning to original view.
 
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

"Gazz_85" wrote:

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?????


Stefi

Returning to original view.
 
One way is to use a helper column: before sorting fill it with =ROW(), Copy
and PasteSpecialValues 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:

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?????


Gazz_85[_2_]

Returning to original view.
 
Cheers guys,

so simple dont know why i didn't think of that!!

much appreciated

"Stefi" wrote:

One way is to use a helper column: before sorting fill it with =ROW(), Copy
and PasteSpecialValues 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:

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?????


Stefi

Returning to original view.
 
You are welcome! Thanks for the feedback!
Stefi

Gazz_85 ezt *rta:

Cheers guys,

so simple dont know why i didn't think of that!!

much appreciated

"Stefi" wrote:

One way is to use a helper column: before sorting fill it with =ROW(), Copy
and PasteSpecialValues 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:

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?????



All times are GMT +1. The time now is 03:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com