Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Matching Files on Different Worksheets | Excel Discussion (Misc queries) | |||
Matching cells to files | Excel Discussion (Misc queries) | |||
Matching Cells in different files to sum. | Excel Worksheet Functions | |||
Help with Matching Text Fields - Then Moving the Matching Cells Side by Side | Excel Discussion (Misc queries) | |||
Matching two files or sheets | Excel Discussion (Misc queries) |