View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Steved Steved is offline
external usenet poster
 
Posts: 519
Default Formula to vba if possible please

Hello Doug From Steved

Doug it looks up a list of names.
ie if I type 10921 in D6 the formula looks up the name and puts it in E6

Thankyou

"Doug Glancy" wrote:

Steve,

I turned on the macro recorder and entered your formula into a cell. A
little tweaking of the resulting code led to this:

Range("E6:E255").FormulaR1C1 = _
"=IF(ISNUMBER(MATCH(RC[-1],R2C19:R2000C19,0)),VLOOKUP(RC[-1],R2C19:R2000C23,2,0)&CHAR(10)&VLOOKUP(RC[-1],R2C19:R2000C23,3,0),"""")"

Or did you actually want to do the calcs in VBA? If so where do you want
the results?

hth,

Doug

"Steved" wrote in message
...
Hello from Steved

Is it possible please to run the below in VBA

The formula is in E6 to E255

=IF(ISNUMBER(MATCH(D6,$S$2:$S$2000,0)),VLOOKUP(D6, $S$2:$W$2000,2,0)&CHAR(10)&VLOOKUP(D6,$S$2:$W$2000 ,3,0),"")

Thankyou.