View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Formula to vba if possible please

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.