Hi guys,
First off I'd like to thank all contributors to this site. I have a lot of your threads to be grateful for!
I have an Excel file, where 'modules' can be selected with a drop down:
Each of these modules have a worksheet with the same name.
I have a VBA code that will only show the worksheets for the Modules that are selected (in this range of C18:C27, the blue cells you see), and hides all worksheets that are not.
So If I select 'Module_FO10' in the first cell, and 'Module RS10' in another, it will unhide the tabs with these same names. As soon as I clear them from my list, they are hidden.
This works perfectly.
What I'd like to have now, is that the worksheets are sorted automatically according to the order of this list in C18:C27. So for example if I select Module_RO20 in C18, and Module_FO10 in C19, I'd like for the worksheet tab of Module_RO20 to be sorted before Module_FO10.
Ideally, it should reset the tab order back to original when the selections are cleared. This can probably be done based on a list I have in a hidden 'helpsheet' with the initial order of the tabs.
I have read a few threads on this, such as here and here, but I can't get it to work.
Thanks in advance for any feedback!
First off I'd like to thank all contributors to this site. I have a lot of your threads to be grateful for!
I have an Excel file, where 'modules' can be selected with a drop down:

Each of these modules have a worksheet with the same name.
I have a VBA code that will only show the worksheets for the Modules that are selected (in this range of C18:C27, the blue cells you see), and hides all worksheets that are not.
So If I select 'Module_FO10' in the first cell, and 'Module RS10' in another, it will unhide the tabs with these same names. As soon as I clear them from my list, they are hidden.
This works perfectly.
What I'd like to have now, is that the worksheets are sorted automatically according to the order of this list in C18:C27. So for example if I select Module_RO20 in C18, and Module_FO10 in C19, I'd like for the worksheet tab of Module_RO20 to be sorted before Module_FO10.
Ideally, it should reset the tab order back to original when the selections are cleared. This can probably be done based on a list I have in a hidden 'helpsheet' with the initial order of the tabs.
I have read a few threads on this, such as here and here, but I can't get it to work.
Thanks in advance for any feedback!