Re Applying Sort Function

katiee

New Member
Joined
Jan 1, 2014
Messages
8
helloo, is it possible to sort a table and by doing so, to re apply the same kind of sorting function onto another table automatically ?

lets say i have created a table in sheet1 from A7 to E14 and another table in sheet2 again from A7 to E14
i wanna be able to sort the table in sheet2 automatically by sorting the table in sheet1, is it possible ?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
katiee,

i wanna be able to sort the table in sheet2 automatically by sorting the table in sheet1, is it possible ?

Probably, if you are using a macro to sort sheet1.


What are the correct worksheet names for the two worksheets?


Can we see your macro code for worksheet sheet1?


If posting VBA code, please use Code Tags - like this:

[code]

Paste your code here.

[/code]



If you are not using a macro, and, you are always sorting the same way, we can create a macro for you.

What cell/cells in the range are you sorting on, and, are you sorting ascending or descending?
 
Last edited:
Upvote 0
sheet1 is named, daily use
sheet2 is named, daily use history

im have this code in sheet1 ( daily use )
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ARow As Integer
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
ARow = ActiveCell.Row - 1
With Target
 If .Column = 1 Or .Column = 2 Or .Column = 3 Or .Column = 4 Or .Column = 5 Then
        ThisWorkbook.Sheets("daily use").Range(.Address).Value = .Value
        ThisWorkbook.Sheets("daily use history").Range(.Address).Value = .Value

    End If
End With
ErrHandler:
    Application.EnableEvents = True
End Sub

and sheet2 ( daily use history ) has this code
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ARow As Integer
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
ARow = ActiveCell.Row - 1
If Target.Column = 6 Then
    Range("G" & ARow).Value = Range("F" & ARow).Value + Range("G" & ARow).Value
    Range("H" & ARow).Value = Range("F" & ARow).Value + Range("H" & ARow).Value
    ElseIf Target.Column = 9 Then
    Range("J" & ARow).Value = Range("I" & ARow).Value + Range("J" & ARow).Value
    Range("H" & ARow).Value = Range("H" & ARow).Value - Range("I" & ARow).Value
End If
With Target
 If .Column = 1 Or .Column = 2 Or .Column = 3 Or .Column = 4 Or .Column = 5 Then
        ThisWorkbook.Sheets("daily use").Range(.Address).Value = .Value
        ThisWorkbook.Sheets("daily use history").Range(.Address).Value = .Value

    End If
End With
ErrHandler:
    Application.EnableEvents = True
End Sub

the 2 tables in both sheets start at A7 and finnish at K139 and have the exact same words in same cells since the first 5 columns in sheet1 and sheet2 are linked as seen above in the code, well its the same 5 columns im trying to have auto sort,
 
Last edited:
Upvote 0
katiee,

the 2 tables in both sheets start at A7 and finnish at K139

In range A7:K7, what cell, or, cells are you sorting on?

well its the same 5 columns im trying to have auto sort

Sort on key A7, ascending or descending????

Sort on another key K7, ascending or descending????
 
Upvote 0
im sorting cell A7 B7 C7 D7 E7 both 2 tables in both sheets.

those are the cells if possible i wanna get them to, if i sort one of the cell in the table the other would sort automatically the same way.

A7 has item names in it so its ( Sort A to Z ) or ( Sort Z to A )
B7 has location names in it so again its ( Sort A to Z ) or ( Sort Z to A )
C7 has requestor names in it so again its ( Sort A to Z ) or ( Sort Z to A )
D7 has numbers only in it so its ( Sort from smallest to largest ) or ( sort from largest to smallest )

i dont understand the last 2 questions :( sowi, but i always sort these 5 cells above and the problem is when i sort in one table, i have to go to the other sheet and sort the other table too the very exact same way i sorted the first table =l
 
Upvote 0
katiee,

1. What version of Excel and Windows are you using?

2. Are you now doing a manual sort?

3. If you use a macro to sort can we see the macro code?

If posting VBA code, please use Code Tags - like this:

[code]

Paste your code here.

[/code]


im sorting cell A7 B7 C7 D7 E7 both 2 tables in both sheets.

A7 has item names in it so its ( Sort A to Z ) or ( Sort Z to A )
B7 has location names in it so again its ( Sort A to Z ) or ( Sort Z to A )
C7 has requestor names in it so again its ( Sort A to Z ) or ( Sort Z to A )
D7 has numbers only in it so its ( Sort from smallest to largest ) or ( sort from largest to smallest )

4. What about column E7?
 
Upvote 0
1.im using 2007
2.im using the insert table option and where theres a flash at the top of the table already available u can click it and sort with it
3.no macro's for sorting i just use the table's flash in the second answer i gave :)
4.and im veeery sorry E7 is also available and it is from A to Z option when i click on the flash in the table cuz its words
 
Upvote 0
katiee,

3.no macro's for sorting i just use the table's flash in the second answer i gave

I do not understand the above quote.

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Last edited:
Upvote 0
katiee,

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top