VBA button to import into data model

blueice2627

New Member
Joined
May 21, 2018
Messages
10
Hi All, I have a scenario where i want to automate as much of a sheet as possible in order to idiot proof how data is inserted into a sheet. For my company, we are able to extract data on a daily basis to show where we are currently sitting. The twist that i want to add is every day we would be importing a new data set, but, we would need to keep the old data sets as well in order to track changes.

I played with a sheet that had a functionality that i liked, but it was locked down so i'm unable to reverse engineer it. Essentially what i would want to have happen is this:

Take cell (A1 for example) and put today's date
Create a button called insert and have it coded to start the importing process:
First open explorer to select file, once file is selected, have it import into a table, on this table it will have a reference column ("Snap Date") that reflects the date that the data is for.
This table must then be combined with the main table that is a collection of all the different data sets from past dates.

Surprisingly i couldn't find anything on google that is similar to what i'm trying to do. I can record a macro through the steps of opening the import screen, but once you select a file, it doesn't do anything past that point.

Any help would be appreciated!
Thanks!
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Rijnsent

Well-known Member
Joined
Oct 17, 2005
Messages
1,300
Office Version
  1. 365
Platform
  1. Windows
Hi blueice,
please do post the code that you did manage to record/write, as it helps massively in helping you, thanks (do so in CODE brackets).
Cheers,
Koen
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,126
Are you using Power Pivot? The data model can be used with or without PP.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,820
Messages
5,627,092
Members
416,219
Latest member
TommyBoy79

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