Matching text files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is it possible to take the addresses from sheet 2 and add them to sheet 1.

Column A has the same names and format on both sheets, they are just in
different order. The data I work with is almost 50,000 records long or I
would just copy and past, or sort, filter or something. But its not that easy!

I'm trying to find a vba way to match up the names so that I can get the
addresses to add to the correct name.

Any ideas?

Thx in advance.
 
Hi Tom,

Thank you for writing back, I can write the formulas, I was looking for a
vba way...I can do a little but not that much!

Thanks again Tom:)
 
It is best to use excel builtin capabilities even in VBA. Also, since you
already know Vlookup:

for each cell in worksheets("Sheet1").Range("A1:A10000")
res = Application.Vlookup(searchstring, _
worksheets("Sheet 2").Range("A1:C50000"),2,False)
if not iserror(res) then
set rng1 = Worksheets("Sheet 2").Range("A1:A50000")(res)
for i = 1 to 8
cell.Offset(0,1).Value = rng1.offset(0,1).value
Next
End if
Next

Another way would be to write the formulas in Sheet 1 using code, then after
they updated, replace them with the values they display.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top