Hi All,
I have setup a datasource in Excel and I am using a Parameter to pass the value from Excel to the SQL database and return the results, this all works fine.
What I would like to do is have the parameter set to the same cell (in my instance this is H14) but the worksheet changes. I have 14 worksheets, and on each of them cell H14 contains the information I need to query the SQL db,
What I want to achieve is that if I am working on 'Worksheet 2' then the parameter being passed to SQL would be 'Worksheet 2!$H$14', but if I was to change and work on 'Worksheet 10' the parameter would look at 'Worksheet 10!$H$14'.
Is this possible? I have been looking into the ActiveWorkbook function, but with no joy. Any help would be great.
I have setup a datasource in Excel and I am using a Parameter to pass the value from Excel to the SQL database and return the results, this all works fine.
What I would like to do is have the parameter set to the same cell (in my instance this is H14) but the worksheet changes. I have 14 worksheets, and on each of them cell H14 contains the information I need to query the SQL db,
What I want to achieve is that if I am working on 'Worksheet 2' then the parameter being passed to SQL would be 'Worksheet 2!$H$14', but if I was to change and work on 'Worksheet 10' the parameter would look at 'Worksheet 10!$H$14'.
Is this possible? I have been looking into the ActiveWorkbook function, but with no joy. Any help would be great.