Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using VB to fill a formula down
I have written an app in VB6 that creates an Excel spreadsheet from an ADODB recordset.
I need to use VB during the creation to add a number ot totals columns. I have the variable osheet declared as an object and can execute the command: osheet.range("E8").value = "=a8+b8+c8+d8". What I need to know is how to fill this formula down the spreadsheet for all the rows returned by the adodb recordset. i.e. ..."e9").value = "=a9+b9+c9+d9" ... etc I can have up to about 9 or 10 totals columns like this that I need to add and the adodb recordset can range from 1 to over 1200 records. Any help would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using VB to fill a formula down
Set rng = oSheet.Range("A1").CurrentRegion.Columns(1).Cells
set rng = rng.offset(1,0).Resize(rng.rows.count-1) rng.offset(0,5).Formula = "=A2+B2+C2+D2" as an example. -- Regards, Tom Ogilvy "eli silverman" wrote in message ... I have written an app in VB6 that creates an Excel spreadsheet from an ADODB recordset. I need to use VB during the creation to add a number ot totals columns. I have the variable osheet declared as an object and can execute the command: osheet.range("E8").value = "=a8+b8+c8+d8". What I need to know is how to fill this formula down the spreadsheet for all the rows returned by the adodb recordset. i.e. ..."e9").value = "=a9+b9+c9+d9" ... etc I can have up to about 9 or 10 totals columns like this that I need to add and the adodb recordset can range from 1 to over 1200 records. Any help would be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill Formula please | Excel Worksheet Functions | |||
formula fill down | Excel Discussion (Misc queries) | |||
Formula Fill help | Excel Worksheet Functions | |||
Fill Down formula Help Please | Excel Discussion (Misc queries) | |||
Help with formula fill down | Excel Discussion (Misc queries) |