I maintain a batch process that inserts summary rows into a database table that is an exact copy of the source table that contains the detail. This is achieved by many Insert Into/Select from statements with various fields in the group by clause and overrides to those that aren't. Determining these summarization requirements is always challenging, I'm speaking SQL and the users speak Accounting.
I would like to build an excel spreadsheet that allows the users to show me exactly how they want the data summarized. My idea is a single Excel spreadsheet with the source data, options for every field that allow them to state whether they want the data grouped by that field, or overridden with an override value. Then the users can hit a button, and the summarized data appears on a new sheet.
Can I write SQL directly within an excel macro on a sheet just like it's a relational database table? Most of the info I've found while searching deals with importing or linking a spreadsheet to a database. I'm not looking for this. Security wise the users don't have access and I'd like to keep it independent of any specific database.
I would like to stick with SQL for the grouping logic as I know it already and I don't have the time to learn grouping logic in visual basic. Can anyone point me in the right direction? Thanks.