Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill Formula please palups Excel Worksheet Functions 5 November 12th 09 08:27 AM
formula fill down Pezcore Excel Discussion (Misc queries) 4 May 10th 08 06:17 PM
Formula Fill help Josh O. Excel Worksheet Functions 1 May 12th 06 09:46 PM
Fill Down formula Help Please singlgl1 Excel Discussion (Misc queries) 6 October 24th 05 08:22 PM
Help with formula fill down comotoman Excel Discussion (Misc queries) 4 October 3rd 05 09:46 PM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"