Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2005, 03:02 AM
Authorized User
 
Join Date: Jun 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help to write codes to sum values

Hi,

I have a table with values and I need to write a code to sum up the values in the rows under each column (starting from Column D). The no. of rows varies everytime. Does anyone know how to do that? .

Thanks in advance.

 
Old July 6th, 2005, 05:05 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sub myRowsSum()
Dim myRows As Integer

myRows = Range("A65000").End(xlUp).Row

Range("D" & myRows + 1).FormulaR1C1 = "=Sum(R1C4:R" & myRows & "C4)"

End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the Sum of all the values in a column.. jhansib4u ADO.NET 1 December 1st, 2007 09:15 PM
how can find Sum of all book values where BookType Rg2005 SQL Server 2000 2 October 8th, 2007 03:03 AM
Sum Textbox Values Snuffles ASP.NET 2.0 Basics 1 April 13th, 2007 01:36 PM
SUM with formula values SiliconFuRy Excel VBA 3 January 7th, 2005 08:17 AM
Sum values by key Justine Oracle 1 April 28th, 2004 03:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.