Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

VOOKUP Macro with varying table lengths

$
0
0

Hi all.

To start my knowledge of macros is limited as I've only recorded them and edited code. I have never written my own code from scratch.

Either way, the problem is as follows. I'm developing a macro that would interact with three files. The first being what we can call the Master Trade file. This will contain the data table we will populate data. The second file is the Daily Trade Blotter, which will contain a table that matches the exact format of the Master file. The only difference between the two is the Master will have all the accumulated data while the Daily Trade Blotter will have new data downloaded daily (and will not include any of the already mined/accumulated/old data.) Thhe third file which we can call VCON contains a table of data with which we are only interested in one coliumn.

Basically, what I need to do is insert a column in Daily Trade Blotter which looks u a column in the VCON file and matches the entry based on an identifying column in both. (This part isn't a problem.)

The second step of the macro is to then copy the table (with the new vlookup column) and insert it into the table in the Master Trade file. The real issue I'm having here is that the Daily Trade Blotter file and the VCON file each day will have a varying amount of records (rows.)

I want to know how I can (in the code) ensure that regardless the length of the table, when copying it will copy all rows in the table.

I may not have been clear, but keep in mind all files are in one folder, and the Daily Trade Blotter and VCON files will be overwritten daily (to ensure the macro is only taking in new data.)

Thanks for any and all help


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>