Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modifying a formula via code
Message
De
07/11/2001 17:29:22
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
VBA
Titre:
Modifying a formula via code
Divers
Thread ID:
00578788
Message ID:
00578788
Vues:
39
In Excel, I have VBA code that automatically creates this formula :

=IF(ISNUMBER(J609),TREND(D604:D609,B604:B609,B609),"")

But when it creates the formula, the ranges change depending upon the data.
Here is the code that creates that formula :

ActiveCell.Offset(0, 3).FormulaR1C1 = "=IF(ISNUMBER(RC[-3]),TREND(R[-5]C[-9]:RC[-9],R[-5]C[-11]:RC[-11],RC[-11]),"""")"

The problem is, I need some absolute values coded in this thing, and can't figure out how to get them in there. Here is how I would LIKE the formula to look upon creation:

=IF(ISNUMBER(J609),TREND(D$604:D$609,B$604:B$609,B609),"")

What can be done to get those little $ buggers in there from the code, so I
don't have to manually edit the formula by hand? THANKS!

Seth
Répondre
Fil
Voir

Click here to load this message in the networking platform