Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loops
I am attempting to run a loop which takes cell A1 and
tries to locate matching cell (e.g. B35) then replacing D1 with C35. Any thoughts on how to write this in a macro in Visual Basic?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loops
Hi
why not use a worksheet function. e.g. the following in D1 =VLOOKUP(A1,$B$1:$C$100,2,0) you can use this also in VBA. Try dim ret_value ret_value = application.worksheetfunction.vlookup(Range("A1"). value,Range("$B$1:$C$ 100"),2,0) Range("D1").value=ret_value -- Regards Frank Kabel Frankfurt, Germany Snow wrote: I am attempting to run a loop which takes cell A1 and tries to locate matching cell (e.g. B35) then replacing D1 with C35. Any thoughts on how to write this in a macro in Visual Basic?? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loops
Thanks Frank. I will try these and see if I can get
either to work. Snow -----Original Message----- Hi why not use a worksheet function. e.g. the following in D1 =VLOOKUP(A1,$B$1:$C$100,2,0) you can use this also in VBA. Try dim ret_value ret_value = application.worksheetfunction.vlookup(Range ("A1").value,Range("$B$1:$C$ 100"),2,0) Range("D1").value=ret_value -- Regards Frank Kabel Frankfurt, Germany Snow wrote: I am attempting to run a loop which takes cell A1 and tries to locate matching cell (e.g. B35) then replacing D1 with C35. Any thoughts on how to write this in a macro in Visual Basic?? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using For - Next Loops in VB | New Users to Excel | |||
Loops etc. | Excel Programming | |||
help with loops | Excel Programming | |||
LOOPS | Excel Programming | |||
Loops | Excel Programming |