Excel/Append download to existing table, ignoring dups
VBA is fine.
I need to append user downloads from a POS back office system to an existing table ensuring dups are removed.
I believe the download will be very dumb (I dont have sample data yet), that is, no system created record number or system number to use to create uniqueness.
I have seen the concept of concatenating all the fields to create uniqueness and this is fine to use here.
So, to recap.
I will open Excel, press button, it will prompt me for file (CSV) and/or grab the latest date stamp file from same path, it will append to my table and then remove dups.
Table will be used for other things such as pivot table, etc.
Now what about this idea and using the code above. If the POS table is a dbf and I can read from it directly, what about an automated process that appends to my table on a schedule. No human interaction.
Eventually, this is probably gonna go to a Office365 sharepoint table and using Access I will create the reports I need.
Let me know what you think.
Here is code to put up a file open dialog to allow the user to select a file and then it is opened.
Dim vNames as Variant
sPath = "C:\Myfolcer\MySubFolder\"
vName = Application.GetOpenFilename("CSV files (*.csv), *.csv", _
Title:="Select file you need", _
If TypeName(vNames) = "Boolean" Then Exit Sub ' cancelled
Now that the data is in new workbook, you can write code to identify duplicates and so forth. When you find a duplicate delete that row in one workbook or the other. When done, you can copy the new data and paste it adjacent to the existing data.
Pulling the latest date stamp file could be done as well.
As far as reading a dbf, I don't believe excel has support for that anymore, but you might be able to get code off the internet to do it.
You could use the windows timer to schedule an excel file to be opened at a certain time and run the code to do what you want describe.