Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
why not use VLOOKUP directly? but if you want try the following: sub foo() dim look_rng as range dim source_rng as range dim target_rng as range dim ret_value with activesheet set look_rng = .range("A1") set target_rng = .rnage("B1") set source_rng = .range("C1:D100") end with ret_value=application.vlookup(look_rng,source_rng, 2,0) if iserror(ret_value) then ret_value="" end if target_rng=ret_value end if -- Regards Frank Kabel Frankfurt, Germany hey wrote: I would like to see the writing for a macro that looks up a value in a table then copies it and pastes it to a certain cell. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
Macro Size Limit / open macros with macros? | Excel Programming | |||
Macros not appearing in the Tools Macro Macros list | Excel Programming | |||
Suppress the Disable Macros / Enable Macros Dialog | Excel Programming | |||
List the Macros that can be executed from Tools-Macros | Excel Programming |