I currently have a worksheet (attached) where I need to pass some parameters to a SQL query.
For each cell where I have to retrieve a value I need to pass the date range and row label to a sql query.
So for example for C3:
SELECT totalsales From tblSales WHERE SeasonCode = "text value from A3" AND Date BETWEEN "value from C2"
The result of this query needs to then be inserted into C3
Ideally I need to then loop through each cell in this row up until the last column of data (in this case column Q) but number of columns will vary.
I then need to do the same for each row where there is a season code
I cant for the life of me figure out a neat way of doing this and would really appreciate any help that anyone can offer.
Bookmarks