Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set rng = Range("M1:M200")(res)
I wasn't familiar with the use of (res) as above. Interesting. Thanks for the ideas. -- Kevin Vaughn "Tom Ogilvy" wrote: You can still use it. You could test first if the value is lower than the lowest value and act according, but if it isn't then use match. Dim res as Variant for each cell in Range("A1:A10") if cell.value < Range("M1") then ' lower than else res = Application.Match(cell.Value, Range("M1:M200"),1) set rng = Range("M1:M200")(res) rng.select end if Next Or you could just use Match and trap for the value. Dim res as Variant for each cell in Range("A1:A10") res = Application.Match(cell.Value, Range("M1:M200"),1) if iserror(res) then ' match raised an error else set rng = Range("M1:M200")(res) rng.select end if Next -- Regards, Tom Ogilvy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Unable to get the VLookup property of the WorksheetFunction class | Excel Discussion (Misc queries) | |||
Unable to match property error | Excel Discussion (Misc queries) | |||
"Unable to get the NormSInv property of the WorksheetFunction clas | Excel Worksheet Functions | |||
Unable to get the Text property of the WorksheetFunction class | Excel Programming | |||
Unable to get the Vlookup Property of the WorkSheetFunction Class | Excel Programming |