Excel 2010 - VBA - Modify macro to sort Autoformat tables after adding new columns.
I need some assistance. Could anyone please help me?
I have several sheets (called Date1, Date2, etc), and all of them have the same structure: they have at least three Autoformat tables (more are added as needed) and each table "had" three columns. In each sheet there is a macro which sorts all the tables at once for the current sheet. If you open the other sheet and run the macro it will sort all the tables for that other sheet. The macro is stored in it's respective sheet, but it's the same macro.
Everything was working perfectly up until I needed to add a FOURTH column to each Autoformat table. Then the macro will not work properly and it does (obviously) messes the data.
The VBA code needs to be modified/adapted so that now it will sort correctly all the tables in the sheet taking into consideration the newly added column. That's it.
The existing code was originally made so that I could simply add "Tablex2", "Tablex3", "Tablex4"... etc. when new tables were added, but in the original code there were only 3 columns per table always... now there are 4.
The original columns for each Autoformat table were:
SEQUENCE 1, SEQUENCE 2, Depth
The new structure is:
SEQUENCE 1, SEQUENCE 2, SEQUENCE 3, Depth
NOTE: Each Autoformat table has a GRAY column (the fourth column as of now, labeled "Depth") which contains a formula. That formula works as expected, but now the macro also messes with hat column.
The button to run the macro is on column W.
Here is the code which works flawlessly but only when the tables have three columns.
In advanced, thank you for any help provided.
See attached file.
Bookmarks