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 February 12th, 2015, 08:42 AM
Registered User
 
Join Date: Feb 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autosum for dynamic Column

How can I change the code below to auto-sum a dynamic column, not just the part where it ended when I recorded the macro.

Code:

Code:
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "=RC[-1]/60"
    Range("F1").Select
    Selection.NumberFormat = "0.00;[Red]0.00"
    Selection.AutoFill Destination:=Range("F1:F82"), Type:=xlFillDefault
    Range("F1:F82").Select
    Range("F82").Select
    Selection.Font.Underline = xlUnderlineStyleSingle
    Range("F83").Select
    Selection.Font.Bold = True
    ActiveCell.FormulaR1C1 = "=SUM(R[-82]C:R[-1]C)"
I want to have the column summed and the sum to be placed on the next column just below the last value it detects, bolded.

TIA.
 
Old February 15th, 2015, 10:41 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Can you try the WorksheetFunction.Sum in your VBA code

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic column sorting victorcorey XSLT 1 October 31st, 2007 05:40 PM
Dynamic Table Column Headers elygp ASP.NET 1.0 and 1.1 Professional 2 May 8th, 2007 04:52 AM
Column Headers for Dynamic Table elygp ASP.NET 1.0 and 1.1 Basics 1 May 8th, 2007 02:43 AM
Dynamic table column sizing tomsi BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 February 1st, 2006 08:58 AM
help required in datagrid dynamic template column govind ASP.NET 1.x and 2.0 Application Design 2 January 4th, 2006 11:32 AM





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