I am still new to Excel VBA and albeit I can get most things to work I am sure there is a better way to do it.
In this example I have created a function to sort my workbook sheets based upon a table column header.
What I really wanted to do was create a function where I could pass the sheet name, table name and column header
into the function, but I just could not get the range correct for the sort key, so I ended up creating a function
where I just passed the sheet name down and used an if statement for all my sheets in the workbook.
The problem with this is I can only ever sort the using a set column in my sheets and if I add another table, I will have to remember
to change the function.
Can anyone help me to reach my goal and get rid of the if statements?
Thanks![]()
Please Login or Register to view this content.
Bookmarks