Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a helper sheet called "counties". In it is a list of all the counties
in Illinois (column A) and the district they belong in (column B). I have a small macro that converts a .csv file to the format that I like, but i'd also like for it to look in Column F of the Data Sheet, match the county and insert the corresponding district in Column G. Anyone help me out with this? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
assuming that counties column A is alpha sorted
assume 132 counties Formula in say - Cell G6 Then copy down =Vlookup(F6,counties!A1:B132,2,False) Vote Republican! "Dominique Feteau" wrote: I have a helper sheet called "counties". In it is a list of all the counties in Illinois (column A) and the district they belong in (column B). I have a small macro that converts a .csv file to the format that I like, but i'd also like for it to look in Column F of the Data Sheet, match the county and insert the corresponding district in Column G. Anyone help me out with this? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range, rng1 as Range
Dim cell as Range, res as Variant With Worksheets("Data") set rng = .Range(.Cells(2,"F"),.Cells(rows.count,"F").End(xl up)) end with With Workbooks("CountyList.xls").Worksheets("Counties") set rng1 = .Range(.Cells(2,1).Cells(2,1).End(xldown)) End With for each cell in rng res = application.match(cell.Value, rng1,0) if not iserror(res) then cell.offset(0,1).Value = rng1(res,2).Value end if Next -- Regards, Tom Ogilvy "Dominique Feteau" wrote in message ... I have a helper sheet called "counties". In it is a list of all the counties in Illinois (column A) and the district they belong in (column B). I have a small macro that converts a .csv file to the format that I like, but i'd also like for it to look in Column F of the Data Sheet, match the county and insert the corresponding district in Column G. Anyone help me out with this? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Exact Match using INDEX, MATCH | Excel Worksheet Functions | |||
index(match) Wind Uplift Calculations (match four conditions) | Excel Worksheet Functions | |||
index match array function-returning only first match, need last. | Excel Worksheet Functions | |||
How do I display more than one match in a Index/Match formula? | Excel Worksheet Functions | |||
index,match,match on un-sorted data | Excel Worksheet Functions |