tuckertubaman
New Member
- Joined
- Jun 15, 2015
- Messages
- 3
Hello,
I'm new to Mr. Excel and have a question about writing a function in VBA.
I need to insert a formula into an excel cell using "ActiveCell.Formula". Here's all I need it to do: find the difference between values. Here's the catch- The location of the values is always changing as I add new data.
Background:
Assume I'm inserting a formula into "A1" and C = 35 (but this value is dynamic)
I'd like a formula something similar to "=RC[C-9]-RC[2*C-18]"
I realize this is improper but it's closest to what I'd like it to do: From the active cell, take the value C-9 (or 35-9=26 currently) columns over and subtract from 2*C-18 (or 70-18=52 currently) columns over.
Any help would be greatly appreciated!
I'm new to Mr. Excel and have a question about writing a function in VBA.
I need to insert a formula into an excel cell using "ActiveCell.Formula". Here's all I need it to do: find the difference between values. Here's the catch- The location of the values is always changing as I add new data.
Background:
Assume I'm inserting a formula into "A1" and C = 35 (but this value is dynamic)
I'd like a formula something similar to "=RC[C-9]-RC[2*C-18]"
I realize this is improper but it's closest to what I'd like it to do: From the active cell, take the value C-9 (or 35-9=26 currently) columns over and subtract from 2*C-18 (or 70-18=52 currently) columns over.
Any help would be greatly appreciated!