VBA Sort Multiple RSS Feeds

fluffynicesheep

Board Regular
Joined
Oct 27, 2009
Messages
69
Hi,

I have a workbook with a number of different rss feeds imported into different tabs/sheets. All the feeds are different table lengths, but they all have the name of a header in common. I wonder if there is any easy way therefore of doing it all at once?

At the moment, my code just goes to a named tab and sorts the named table by the [date] column ... I would have to write this hundreds if times, so wondered if there was a way of going through the tabs one by one, seeing if there is a table present and if so, if there is a header called [Date] then it sorts it by descending order?

Below is the code I'm using to sort each one separately at the moment (first 2 tables out of hundreds only!!)

Code:
ActiveWorkbook.Worksheets("Charity").ListObjects("Table307").Sort.SortFields _        .Clear
    ActiveWorkbook.Worksheets("Charity").ListObjects("Table307").Sort.SortFields _
        .Add Key:=Range("Table307[[#All],[Date]]"), SortOn:=xlSortOnValues, Order _
        :=xlDescending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Charity").ListObjects("Table307").Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With




ActiveWorkbook.Worksheets("Finance").ListObjects("Table327").Sort.SortFields _
        .Clear
    ActiveWorkbook.Worksheets("Finance").ListObjects("Table327").Sort.SortFields _
        .Add Key:=Range("Table327[[#All],[Date]]"), SortOn:=xlSortOnValues, Order _
        :=xlDescending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Finance").ListObjects("Table327").Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With


Any help would be greatly appreciated!

Thanks
 
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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