When I execute this command I get the exact same formulas in both columns:
wks.Columns(i + 1).Formula = wks.Columns("E").Formula
How can I tweak this to copy relative formulas? I don't want to use the copy command.
When I execute this command I get the exact same formulas in both columns:
wks.Columns(i + 1).Formula = wks.Columns("E").Formula
How can I tweak this to copy relative formulas? I don't want to use the copy command.
I think you have to use...
Copy command ... in vba..
No other way....
Don't forget to click *
There are always other ways
One option is to write each formula in VBA:
Range(i, 10).Formula = "=something" & something_dynamic & ")"
Range(i, 11).Formula = ...
...
...
...
This isn't the kind of VBA programming I do, but I think this is where using formulaR1C1 (using R1C1 formulas) can be very useful. The thing about R1C1 formulas is that, when they are copied, the actual "text string" for the formula doesn't change. So, in VBA, we can build the formula string once (or read it from another cell), and put the same formula text string into another cell/range without modifying the formula string.
As noted, I'm not real good with this kind of programming, but it might be worth the time and effort to research and test this kind of approach.
Originally Posted by shg
Thanks, I'll try the R1C1 format
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks