![]() |
Matching text files
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. |
Matching text files
Look in Excel Help at the Vlookup function
-- Regards, Tom Ogilvy "Tim" wrote in message ... 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. |
Matching text files
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:) "Tom Ogilvy" wrote: Look in Excel Help at the Vlookup function -- Regards, Tom Ogilvy "Tim" wrote in message ... 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. |
Matching text files
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. -- Regards, Tom Ogilvy "Tim" wrote in message ... 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:) "Tom Ogilvy" wrote: Look in Excel Help at the Vlookup function -- Regards, Tom Ogilvy "Tim" wrote in message ... 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. |
All times are GMT +1. The time now is 04:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com