makeitwork09
Technical User
I am about to embark upon a task using Excel VBA, but my experience is somewhat limited. I want to go at this task using best practices and I figured it was best to first get advice from more knowledgeable people than I.
Currently, I am storing data in and Access database (Access 2002 - I also have Access 2007, but not all users have been migrated to that yet), but I eventually may be using SQL Server.
The users want a common set of data, but any or all of the following will be desirable:
(1) ability to have different groupings (i.e. investor level data, loan level data only, or loan level data, but grouped by property type)
(2) ability to have different parameters (i.e. a particular city, a particular property type, all property types, all regions, a particular region, etc.)
(3) given the above, that means the subtotals would need to change on the fly.
(4) ability to add fields that were not included in the core set of fields provided. I was thinking a drop-down list would be required to select the remaining fields from the table and allow them to select one or more fields and them pass these values to create a SQL string. Thing is I am not sure of the best way to accomplish this? Do I use controls or form objects in Excel?
For the above, I was thinking maybe dynamic SQL strings will be required to build out the group by statements. Would that be the best thing to do. I was even thinking if they just wanted a data dump, a group by statement would not be necessary, thus again, some sort of string and if-then or case statements would be required?
Additionally, for the selections mentioned in 1 and 2 specifically, I was thinking I need a named range, but since data can be added, I was thinking this needs to be dynamic. Would it be best to create dynamic named ranges using offset in VBA code or using Insert -> Name -> Define?
I usually start my VBA code by using Record Macro and then modify them accordingly. Is that advisable when dealing with SQL? If not, how should I approach this? Examples, or links, are appreciated.
Thank You in advance for your advice and guidance.
Currently, I am storing data in and Access database (Access 2002 - I also have Access 2007, but not all users have been migrated to that yet), but I eventually may be using SQL Server.
The users want a common set of data, but any or all of the following will be desirable:
(1) ability to have different groupings (i.e. investor level data, loan level data only, or loan level data, but grouped by property type)
(2) ability to have different parameters (i.e. a particular city, a particular property type, all property types, all regions, a particular region, etc.)
(3) given the above, that means the subtotals would need to change on the fly.
(4) ability to add fields that were not included in the core set of fields provided. I was thinking a drop-down list would be required to select the remaining fields from the table and allow them to select one or more fields and them pass these values to create a SQL string. Thing is I am not sure of the best way to accomplish this? Do I use controls or form objects in Excel?
For the above, I was thinking maybe dynamic SQL strings will be required to build out the group by statements. Would that be the best thing to do. I was even thinking if they just wanted a data dump, a group by statement would not be necessary, thus again, some sort of string and if-then or case statements would be required?
Additionally, for the selections mentioned in 1 and 2 specifically, I was thinking I need a named range, but since data can be added, I was thinking this needs to be dynamic. Would it be best to create dynamic named ranges using offset in VBA code or using Insert -> Name -> Define?
I usually start my VBA code by using Record Macro and then modify them accordingly. Is that advisable when dealing with SQL? If not, how should I approach this? Examples, or links, are appreciated.
Thank You in advance for your advice and guidance.