excel - VBA -- variable in .formula -


is there more elegant (simpler) way put variable in .formula? don't want use .formular1c1

i have code:

range("c8").select selection.end(xldown).select posr = activecell.row konr = posr - 2 range("n" & posr).select aaddress = range("$n$9").address & ":" & range("$n$" & konr).address activecell.formula = "=sum(" & aaddress & ")" 

obviously want put =sum($n$9:$n$101) (101 last cell minus 2) cell , code job. want sure easiest way this.

the easiest way skip selecting , variables

posr = range("c8").end(xldown).row range("n" & posr).formula = "=sum($n$9:$n$" & posr - 2 & ")" 

edit: more explicit, easiest way use formular1c1 said didn't want to, so...


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -