I have a macro that is working fine for the spreadsheet that I initially created it for. But I got to thinking that it's something I have to do at various times, so want to make it more dynamic.
To start with, I have a spreadsheet with data in columns A-G, which is sorted by F-A-C. So, the rows are grouped by data in F. My macro adds "regular" borders to the whole sheet and thick borders around each group designated by the data in F. So far, all is good.
But sometimes, I'll have other reports where I want to do the same thing, except that there may be more or fewer columns and the data for the first sort is in a different column than F.
I'm thinking that if I could get the macro to call up a combobox (or something better, if you have any ideas) that includes all of the headers in row 1 for the user to select from, then have the macro continue, using THAT column instead of F to determine where the borders need to be thin or thick.
I'm attaching a workbook in which Sheet1 is the original report that was the basis of the macro and Sheet2 is the result. Sample1 is a different report where I've sorted by B and that's the column to be used in determining which rows get grouped with a thicker border. Sample2 is the result needed from that.
To do the 2 Sample sheets, I manually changed the code to use B instead of F. What I'm hoping is that the macro could pop up a combobox with all the headers on that particular report so that you can choose which to use and, once you select, the macro continues.
I hope I've explained this clearly enough; if not, let me know and I'll try again.
Here's the code I have so far:
Please Login or Register to view this content.
Thanks!
Jenny
Bookmarks