Short Version
Is there a way to have visually represented user re-sizable data ranges in Excel? (If so, via VSTO?)
Long version
I’m writing an add-in to Excel that helps with exporting data within arbitrary workbooks to existing database tables. The data is more or less tabular but it’s almost always laid out differently. I’m looking to make the process as error free but quick as possible. For example, columns for ranges of tabular data have their header names ranked for similarity to a pre-determined field names list. The rankings are then fed into a solver for the assignment problem. This allows columns to be mapped to fields automatically with surprisingly high accuracy.
However, detecting the ranges of tabular data isn’t feasible — often not all of the data is wanted for export. Therefore, I’m looking to make a familiar yet quick to operate user interface for users to specify the tabular data ranges within a workbook.
One such user interface would be to have the user draw and re-size the ranges they’d like to export. Thus, I’m seeking to do exactly that. However, I’m open to other user interface ideas if they’re more conducive to implementation yet still easy to use.
The solution I’ve ended up with is creating a scratch copy of the worksheet and managing the formatting of it in order to highlight various portions of it — instead of user-resizable areas they’re “painted” instead by selecting cells. (The interface takes the form of a familiar paint program in a way with various tools that allow you to manipulate the cell information in certain ways.) The data export region and normal modes are switched between with a toggle bottom.
Under the hood it’s not a pretty, elegant solution, but it’s pretty slick for the end user.