Excel VBA, finding the row count of a range and applying it to the end of another range -
i'm working through vba project in excel (2010 running in xml, not xmls) , i'm having troubles. in short, i'm running =if((or(not(iserr(search....etc in cell far right of sheet. then, need xlfilldown, need range dynamic. rows if statement searching varies tab tab, , there data below (separated 1-2 blank rows!) may contain same strings i'm searching for, provide wrong data.
so, possible track row number of endpoint of column in data being if((or(not(iserr(search , apply column number endpoint of range, xlfilldown goes far table? , if so, how done?
thanks all!!
range("if2").select activecell.formula = _ "=if((or(not(iserr(search(""perf"",a24))),not(iserr(search(""profi"",a24))),not(iserr(search(""commu"",a24))),not(iserr(search(""equip"",a24))),not(iserr(search(""occu"",a24))),not(iserr(search(""emplo"",a24))),not(iserr(search(""liqu"",a24))),not(iserr(search(""withholding"",a24))),not(iserr(search(""ince"",a24))),not(iserr(search(""trust"",a24))),not(iserr(search(""mana"", a24))),not(iserr(search(""mgmt"", a24))),not(iserr(search(""incentive"", a24)))))=true, c24, 0)"
i need fill-down until last cell containing in a, ideas?
your formula can reduced like
=if(sum(iferror(search(words,a24),0))>0,c24, 0) entered array formula (ctrl+shift+enter), words named range words search for. might find easier maintain.
dim f range activesheet set f = .cells(rows.count, 1).end(xlup) if f.row >= 24 .range("b24").formulaarray = _ "=if(sum(iferror(search(words,a24),0))>0,c24, 0)" .range("b24:b" & f.row).filldown end if end
Comments
Post a Comment