Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cells C3:AB3 summed
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00903569
Message ID:
00903663
Views:
13
>Hi! Doing some automation in Excel.
>
>Want to put a sum into a cell from cell say C3 to AB3?
=SUM(A3:AB3)?
>
>The columns increase or decrease depending on how many products are selected in Foxpro,
How is the data getting to Excel. Is VFP writing the values with automation, or, are the cells being populated with "COPY TO XLS"

If VFP is writing the cell with automation, then you can sum them during the "write" to a VFP variabble.

If VFP is not aware of the structure of the worksheet, then the VBA will need to apply keystrokes in the automation (END+DNARROW=bottom of row)

The recorded macro reveals something like this:
ActiveCell.FormulaR1C1 = "=SUM(R[-4]C:R[-1]C)"
>

Hoiw is the data getting to the sheet? VFP Automation, or is the sheet an XLS copy or a "pre" existing worksheet?

>Q: How do I do a SUM command using cells references rather than cell names ie CELL(3,3) not A3
>
>or can I work out the name (A3) from the cell reference?
>
>HTMS
>
>TIA
>
>Robin
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform