Sort Dynamic Table with Condition

zinah

Active Member
Joined
Nov 28, 2018
Messages
353
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have the below table, what I need is to sort the numbering by ascending order, it's easy if I have a fixed table, but the challenge is this table is dynamic, it changes whenever I change the EE ID. Can you help me with the formula that solve this issue?

EE IDAAAA
KEY_EEIDGoal#Goal Overall ProgressObjectiveCategoryMetric/OutcomesActive/DeletedNumbering
AAAA11NOBBBBBBOEnnnnnActive3.2
AAAA22NOCCCCCOEjjjjjActive3.1
AAAA33YESKKKKBEeeeActive4.2
AAAA44YESLLLLOErrrActive1.1

<tbody>
</tbody>



Thank you
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi,

It seems to me the dynamic part is in fact when you are changing the Key_EEID ....

If it is the case, an event macro could run your Sort macro as soon as you are changing anything in Column A ...

Hope this will help
 
Upvote 0
Hi,

Thank you for your respond! Yes, you're right. Can you please share the suggested macro?
 
Upvote 0
Hi again,

In your sheet module, you could test following:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
If Target.Target > 1 Then Exit Sub
Dim last As Long
last = ActiveSheet.Cells(Application.Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Range("A1:H" & last).Sort [A1], xlAscending, Header:=xlYes
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Hope this will help
 
Upvote 0
I copied the macro to my sheet and when I tried to run it, it didn't show this macro in my drop-down list of macros, I even copied it to a new workbook and the same happened. Is there anything I can do to fix? I have named the range of each column if you want I can share them with you?
 
Upvote 0
Hi,

That's super great! thank you so much for your help and guidance.
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,438
Members
448,897
Latest member
dukenia71

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