torturedmind
Programmer
Hello all,
I'm stumped on this particular MS Excel automation wherein I was trying to put a formula in a cell whose formula range varies depending on the user's input.
That is, the "AVERAGE(C10:AG10)" part may be "AVERAGE(C10:Z10)" only or it may be "AVERAGE(C10:XFD10)" and so on. I'm thinking of using the CHR() function but really don't know where to grasp the idea on how to approach this. Will someone please guide me to the right direction? Thanks in advanced.
Regards,
kilroy
philippines
"Once a king, always a king. But being a knight is more than enough."
I'm stumped on this particular MS Excel automation wherein I was trying to put a formula in a cell whose formula range varies depending on the user's input.
Code:
oSheet.Range("C13").Formula = [=IFERROR(ROUND(AVERAGE(C10:AG10),0),"-")]
That is, the "AVERAGE(C10:AG10)" part may be "AVERAGE(C10:Z10)" only or it may be "AVERAGE(C10:XFD10)" and so on. I'm thinking of using the CHR() function but really don't know where to grasp the idea on how to approach this. Will someone please guide me to the right direction? Thanks in advanced.
Regards,
kilroy
philippines
"Once a king, always a king. But being a knight is more than enough."