Looking for a safeguard in a raw data macro...

jjacks60

New Member
Joined
Jul 28, 2014
Messages
40
So I'm compiling a raw data sheet from a production sheet. My Raw Data will contain SKU #, Actual Volume Produce that wednesday Aug.27th day, Actual Volume produced Wednesday Aug. 27th night.

The production sheet is below [I can only show so much on a public forum]:

and

Currently I have a macro that grabs this production data, which updates data daily, and transfers it to the current workbooks file.

I'm trying to extract the data from the work files but avoid duplicating data. I.E. I have a macro button now that a user can press and it grabs the data and puts it onto a raw data sheet. But I have no safeguard to keep the same data from being duplicated - I.E. I don't want volume from August 12th during the day to be duplicated when I run the report on August 13th given the August 12th data will still be on the file..

So essentially - any guidance regarding compiling data while avoiding duplicating data in macros would be appreciated, especially when the data is in a format such as above. I'm not asking anyone to write the macro itself, as this will obviously take some time - just need input to figure out HOW I want to build this to avoid duplicating data and skewing forecasts.
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If there is a way to create a unique ID, you can then loop through the last 100 rows and check if any data is duplicated.

Another way is to first loop through the raw data (using the last imported row value) backwards and as soon as you find an exact match have the importing start at [match row + 1].

Neither of these will take a considerable amount of time unless your data is approaching the 500,000 row mark. Depending on the length of the raw data, I would utilize the second option as you will get an exact match.

Another option, which I don't think will work for your data set but it might, is when a row is imported, append that row with an X or some other distiction. That way, you can add logic into your import function that is along the lines of:

Code:
If import.cells(x, 14) = 'x' 
Then 
goto skipRow
else 
' import code
end if
skipRow
next x
 
Upvote 0

Forum statistics

Threads
1,215,831
Messages
6,127,145
Members
449,363
Latest member
Yap999

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
Back
Top