Hello all,
I have learned an incredible amount here and would like to thank
everyone for that. Unfortunately, I have come up with something that I
can't find a clear enough answer for.
I have a macro that takes four seperate csv files exported from another
program and compiles them onto a single Excel worksheet. The csv files
always have a different number of rows and, depending on whose machine
they were exported on, the columns are in different orders and possibly
different amounts. As a result I have had to keep the macro as
"generic" as possible to keep it from breaking when used by different
users. I had originally put the output from the csv files into pivot
tables but determined that countif would be faster and more compact. So
far it has been, now that I have figured out how to make most of it
work. I even figured out how to find the right column to look at no
matter where it was in the file.
The problem is with the last of the four csv files. The details are
that I have x number of products (varies by day) stored in 2 locations.
I need to find out how many of product A are in location 1, how many in
location 2, how many of product B are in location 1, how many in
location 2, etc, until I run out of products. I have tried a few of the
examples posted here in the past and either get a mismatch error or a
zero sum.
What I need is VB code that will use variables for the range(s) due to
the changing nature of the source, that will use variables for the
criteria since it will be looping through the product list that is
subject to change, and will produce two seperate variables that can be
used as cells(r,12).value and cells(r,13).value (location 1 and
location 2).
I would rather start "fresh" but will post my current broken code if
requested to.
Thanks in advance.
Bill
Bookmarks