Excel - copy formula in one field across X columns and down to the last row in VBA -
let's had formula in cell b2
=iferror(mid($a2,find("|",substitute($a2,"@","|",b$1)),iferror(find(" ",$a2,find("|",substitute($a2,"@","|",b$1))),len($a2)+1)-find("|",substitute($a2,"@","|",b$1))),"")
in vba< how copy down last row , across (and including column p)
i've seen examples shows single column not multiple e.g. vba fill formula down till last row in column
assuming number of rows determined data in column a, try:
dim lrow long activesheet lrow = .cells(rows.count, 1).end(xlup).row .range("b2:p" & lrow).formular1c1 = "=iferror(mid(rc1,find(""|"",substitute(rc1,""@"",""|"",r1c)),iferror(find("" "",rc1,find(""|"",substitute(rc1,""@"",""|"",r1c))),len(rc1)+1)-find(""|"",substitute(rc1,""@"",""|"",r1c))),"""")" end
Comments
Post a Comment