PDA

View Full Version : Formula in VBA module



adamsm
02-26-2011, 12:44 AM
Hi,

How would I place the following formula in the worksheet module so that when the user adds data rows to column C, the formula gets copied into column H of the worksheet.

=IF(F18="","",VLOOKUP(F18,Products!$A$3:$E$1371,IF(O10="Discount",5,5),0))

and the following gets copied to the column K of the active worksheet.

=IF(F18="","",VLOOKUP(F18,Products!$A$3:$E$1371,IF(O10="Discount",2,2),0))

Any help on this would be kindly appreciated.

Thanks in advance.

Bob Phillips
02-26-2011, 08:13 AM
Excel 2007? If so, convert it to a table, new rows inherit the formulas.

adamsm
02-26-2011, 11:04 AM
Thanks for the help xld. I do really appreciate it.