View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Paul Black Paul Black is offline
external usenet poster
 
Posts: 394
Default Help with Coding a Formula Please

Dana DeLouis
Brilliant!, your Formula DOES Indeed give the Same Results.

Dave Peterson
Thanks VERY Much for the Reply & Code.
I have Substituted Dana DeLouis' Formula for my Original One in your
Code and it Works Great.
One Other Question Please.
I would like to Put a Number in Cell "B29" that will be the Number of
Rows that I would like the Formulas to be Copied to.
For Example, if I was to Enter the Value 100 in Cell "B29", I would
like the Formulas to Fill Cells "C31:J130" and Also have the Values 1
to 100 ( like a Counter ) in Cells "B31:B130" Please. Is this Easy to
do.

Here is the Code I am Using :-

Option Explicit
Sub testme()

Dim myFormula As String

myFormula =
"=IF(ISERROR((1-$B$27/$B$28)^($B31-C$30)*($B$27/$B$28)^C$30*" & _

"COMBIN($B31,C$30)),"",(1-$B$27/$B$28)^($B31-C$30)*($B$27/$B$28)^C$30*"
& _
"COMBIN($B31,C$30))"

myFormula = Application.Substitute(myFormula, Chr(34), Chr(34) &
Chr(34))

With ActiveSheet.Range("c31:j95")
.Formula = myFormula
.NumberFormat = "0.00%"
End With

End Sub

What does the ...

myFormula = Application.Substitute(myFormula, Chr(34), Chr(34) &
Chr(34))
.... Bit Actually do Please.


Thanks to you Both for your Time & Help.
All the Best.
Paul