Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to sort a Straight Table by, depending on the user column selection.
If possible, I would like to do so via a macro, as the same user selection will be applied to several charts (easier to copy to the other charts).
The user can select 1 of 3 criteria, which is stored in a variable 'Order_By'.
Then I tried using the macro below:
Sub Order_By
If ActiveDocument.Variables("Order_By").GetContent.String = "SIR No" Then
ActiveDocument.GetSheetObject("Table_All").SortBy 1
Else
If ActiveDocument.Variables("Order_By").GetContent.String = "Application" Then
ActiveDocument.GetSheetObject("Table_All").SortBy 3
Else
If ActiveDocument.Variables("Order_By").GetContent.String = "Status" Then
ActiveDocument.GetSheetObject("Table_All").SortBy 33
End If
End If
End If
End Sub
This doesn't fully work.
Also it seems to mess up the 'Sort By Columns Priority', if I take a look at the chart properties.
How can achieve a simple sort by a specified column ?
Thanks
Hello Rebecca . I'm trying to run what do you showed in the example ... I need to sort the columns Cause value and value payment is made .. can help me ...