Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Joel,
Thank you for responding, I get syntax error becase this line is in red: closest = rng1) any idea? thx. Joel wrote: Sub CopyIDData() Dim rng As Range Dim rng1 As Range Dim cell As Range Dim res As Variant With Worksheets("sheet1") Set rng = .Range(.Range("A1"), .Range("A1").End(xlDown)) End With With Worksheets("Sheet2") Set rng1 = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown)) End With For Each cell In rng first = true for each cell1 in Rng1 if first = true then closest = rng1 first = false else if abs(rng - rng1) < abs(rng - closest) then closest = rng1) end if next cell1 cell.Offset(0, 1) = closest Next End Sub Hello, [quoted text clipped - 55 lines] Thank you. -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help! Find Closest Coordinate Match | Excel Discussion (Misc queries) | |||
Find closest text match for each unique entry in a list | Excel Discussion (Misc queries) | |||
Find closest match and copy | Excel Discussion (Misc queries) | |||
Find the closest match to a reference number in a row of unsorted | Excel Worksheet Functions | |||
find closest match to a reference number in a row of numbers | Excel Discussion (Misc queries) |