Wrox Programmer Forums
|
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 April 25th, 2007, 05:20 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default storing values

Can anybody help!

I have created a userform with excel vba & in this user form the user is asked to enter various values when I run the process once the expected results are output into an excel spreadsheet. The problem I am having is allowing the user to add more than one set of values to create an accumulated total for each of the outputs. I.e. I want to be able to store the output variables & add to them.

I have tried various methods to do this but I am just learning the subject. One of my ideas is shown below.

Hrs = (Formulae that gives the hours goes here)
other code
other code
etc.

AcumHrs = (Formulae that gives the next set of hours goes here)
Hrs = AcumHrs + Hrs

The Hrs on the left of the '=' sign adds the previous 'Hrs' value, (on the right) to the 'AcumHrs' to give an accumulated value for the Hrs variable.


 
Old April 25th, 2007, 11:33 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi Paul

I am not clear abt your query

If it is getting the acummultated hours

you can change

Hrs = AcumHrs + Hrs

to

AcumHrs = AcumHrs + Hrs

that should work

Cheers
Shasur

http://www.vbadud.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
storing fields values in variable from openqury imaginevictor SQL Server 2000 1 July 12th, 2007 02:42 AM
storing field values to variables imaginevictor SQL Server 2000 1 July 3rd, 2007 02:17 AM
Storing Problem! doosti Classic ASP Databases 3 December 5th, 2004 10:18 PM
Storing multiple values from the dropdown list lily611 SQL Server 2000 0 June 21st, 2004 06:08 AM
Storing multiple values from the dropdown list lily611 ADO.NET 0 June 21st, 2004 05:21 AM





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