LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Insert SUM Formula using VBA (Range Varies)

I have a macro that pulls a lot of text files and creates one Excel file. I
want the macro to insert SUM formulas into various places in the Excel file.
Could someone give me the VBA code to enter a SUM formula that calculates the
sum of a range that starts in row 8 and ends in 1 row up from where I am
putting the formula. Example - if I am putting the formula in cell B36 I
want the formula to SUM the range B8:B35. The starting row B8 will always be
the same but the ending row B35 will vary.

Thanks,
Bill Horton
 
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
Can a range be copied if it varies in size? TheMilkGuy Excel Discussion (Misc queries) 4 August 12th 09 10:05 PM
Setting a range that varies Stephen English Excel Programming 2 April 6th 09 08:43 PM
Sum of a range that varies Sebastien Excel Discussion (Misc queries) 1 February 19th 08 04:19 PM
Macro to insert a formula based on a range MarcusA Excel Discussion (Misc queries) 1 December 8th 06 09:26 AM
How to insert formula to a range of cells from VBA? crapit Excel Programming 10 March 18th 05 01:38 PM


All times are GMT +1. The time now is 03:17 AM.

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

About Us

"It's about Microsoft Excel"