vba on datasource

Dwjenkins

New Member
Joined
Nov 14, 2013
Messages
4
Hi All

I have connected Microsoft Query to download from my SQL Server with a Parameter from a cell.

However, when it runs it deletes all the information within the table. But what I want it to do is append the date to the end.

Basically, cell A2 has a DateID based on the formula =max(N:N)-8, the query then returns all date for the past 8 weeks. It should then overwrite the 7 weeks of data with anything thats changed and the 8 week will always be new data.

I am assuming that I need some vba wizardy here.
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

wrightyrx7

Well-known Member
Joined
Sep 15, 2011
Messages
994
You already have a Macro to do to fetch the data? You just want the code amending to put the new data in the correct location? (If so can we have a look at the code)
 

Dwjenkins

New Member
Joined
Nov 14, 2013
Messages
4
No its not a macro, it comes from a DataSource through microsoft query.

I was thinking about this earlier and 'updating might not be best way of doing it. I think it should probably delete the last 7 weeks of data and then once the DataSource is run it should append the data to bottom of the current table.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,632
Messages
5,597,287
Members
414,134
Latest member
Tiyas44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top