Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Automation: Adding formulas into cells

Status
Not open for further replies.

ganj

IS-IT--Management
Nov 3, 2001
19
AT
I am creating an Excel sheet from a VFP cursor - simple and straighforward. But when it comes to entering formulas in columns, I'm stuck.

How can I enter any kind of formula, including Excel functions in a range of cells? the kind of formula I need to enter is something like: =sum(a2..z2)/$a$1

TIA
 
This example puts a formula into cell D929 which is the sum of all cells in the range D4:D927. You can really put whatever you want into the formula based upon values you've already figured out previously.

oExcel.ActiveSheet.Cells(929,4).Formula = "=SUM(D4:D927)"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top