There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard netgear network printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: excel updating calulations

Reply  
Thread Tools
scouse13's Avatar
Member with 127 posts.
 
Join Date: Oct 2009
30-Oct-2009, 09:31 AM #1
Solved: excel updating calulations
is the following possible, if so what code would i use

i have a box on a worksheet for entering a value, and a second box that i want to keep as a running total, when a value is entered in the first box, i would like the second box to update with the first figure, if another value is entered in the first box the second box needs to add that to the first figure and update.
turbodante's Avatar
Senior Member with 744 posts.
 
Join Date: Dec 2008
Location: GMT UK
30-Oct-2009, 11:45 AM #2
Is this what you meant?

Needs to go into the sheet's (code)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim wb As Workbook, ws As Worksheet
    Set wb = ThisWorkbook
    Set ws = wb.Worksheets("sheet1")
    
If Not Intersect(Target, Range("G7")) Is Nothing Then
ws.Range("H7").Value = ws.Range("H7").Value + ws.Range("G7").Value
End If
        
End Sub
turbodante's Avatar
Senior Member with 744 posts.
 
Join Date: Dec 2008
Location: GMT UK
30-Oct-2009, 12:48 PM #3
Thanks for PM, scouse.

In the above, what I meant by sheet's (code) is...

In VBA, you will normally see your code in a Module. In this instance, we want to put this code in the sheet. Double click on the sheet on lefthand project window, and paste the code above.

The code used cells H7 and G7, where H7 will be updated whenever G7 is changed.

If anyone this is still unclear, please shout.
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 5,030 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
31-Oct-2009, 04:12 PM #4
turbodante, is the ws reference to the housed worksheet?
turbodante's Avatar
Senior Member with 744 posts.
 
Join Date: Dec 2008
Location: GMT UK
02-Nov-2009, 04:54 AM #5
Quote:
Originally Posted by Zack Barresse View Post
turbodante, is the ws reference to the housed worksheet?

I see what you're hinting at Zack. Both ws and wb are unneccessary.
Reply

Tags
calculations

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:25 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.