Set formula as variable w/o "=" sign

G

Guest

I have the following formula in my cell
=AVERAGE(OFFSET(C15,-3,0,-12,1))

I want to set a variable as the formula, such as
MyFormula = ActiveCell.Formula

How can I get rid of the "=" sign at the beginning? I basically need to add
a condition to the beginning and end of the formula and don't want the "="
inserted in the middle.
 
B

Bernie Deitrick

Stephanie,

MyFormula = Mid(ActiveCell.Formula, 2, Len(ActiveCell.Formula))

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top