Q
Q
Quip Quip2016-11-06 12:07:38
Visual Basic
Quip Quip, 2016-11-06 12:07:38

How to write a macro in VBA that will collect data from two Excel sheets?

There are two Excel sheets with data (in one workbook): a "before" sheet and a "after" sheet (let's say it will be inventory data). The sheets contain data in the format:
Table "before":
c836a6f679b24cd7ab7c74f7d028a874.png
Table "after": It is
6d2deab3acbd41f3bf54bf25185c55c1.png
necessary to combine the data from two sheets in such a way as to remove all repetitions of books, and upload the rest of the data in the same format, highlighting the data from the table before and from in different colors tables after. Approximately it should look like this:
b2db0401a39643b1a3e851a99bab2950.png
I tried to compare using InStr and then display those that do not suddenly enter into a friend, but something does not work out. How to write such a macro. Can anyone at least give me a hint?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nApoBo3, 2016-11-06
@QuipQuip

Your data format is not correct. Entries should be in the following format.
Or two sheets with inventory dates, and there are entries like string, author | title.
Or one sheet with lines like author|title|quantity|event|date.
A macro is not required here, a pivot table can handle everything.
If you really want to do this, then cycle through the first table and then through the second, but it can turn out very slowly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question