Hi All,
I have a worksheet called "Actuals" with a query on it.
The source behind the query is an excel file with multiple worksheets by week ex. W1, W2, W3, ...
For example in week 3, I want to see worksheets W1, W2 and W3.
I go to my ribbon in excel: Data > connections > properties > Definition > Command text
There I type :
SELECT `W1$`.*
FROM `XXXXXXX.xlsm`.`W1$` `W1$`
Union all
SELECT `W2$`.*
FROM `XXXXXXX.xlsm`.`W2$` `W2$`
Union all
SELECT `W3$`.*
FROM `XXXXXXX.xlsm`.`W3$` `W3$`
Is there a possibility to update this automatically with a macro?
So if I push a button, another week is added.
Thanks in advance.
If anyone would like an example, feel free to ask.
kr Jones
Bookmarks