Range("A3:D3").Formula = "=A4+A5"
will do what you describe. No need to enter the formula and copy it or to
loop and adjust the formula yourself - do it all in one step and let excel
manage the addresses by using relative references.
--
Regards,
Tom Ogilvy
"sameerce " wrote in message
...
Hi,
I want to incorporate formulas to different cell on command button
click. The formula is common for different columns just the position of
the cells value to be used shifts by one column.
To explain, say I have a formula for cell A3 which is A3=A4+A5.
Similary, I want to use this formula for the next cells like B3=B4+B5
and so on for C,D.
Instead of writing the same formula every time, I want to make this
dynamic by changing the value of A to B, C and so on.
I tried using Range((Chr(Asc("A") + i)) & iCounter).value by putting
this stmt in a for loop for i. But, this thing when put in the formula
does not works.
Can anyone suggest a solution to this problem.
Thanks,
Sameer
---
Message posted from http://www.ExcelForum.com/