I need help with a formula. I need to add different numbers from a single cell. For example I need to be able to enter an 8, delete the 8, then enter an10 in the same cell and the total to come up as 18. Any help would be greatly appreciated.
I need help with a formula. I need to add different numbers from a single cell. For example I need to be able to enter an 8, delete the 8, then enter an10 in the same cell and the total to come up as 18. Any help would be greatly appreciated.
This can be done using VBA. This basic code can do the trick. Adapt it as necessary.
![]()
Dim val As Double Private Sub Worksheet_Change(ByVal Target As Range) With Application .ScreenUpdating = False .EnableEvents = False If IsNumeric(Target) Then Target = Target + val End If .ScreenUpdating = True .EnableEvents = True End With End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If IsNumeric(Target) Then val = Target.Value End If End Sub
I'm relatively new to excel and I'm not sure how to enter that information into Excel. I have never used VBA before.
also look here
http://support.microsoft.com/kb/213445
If you are new to VBA, your best bet is to post a sample of your workbook so we can see your formatting and layout. This is important because it will help us trap for errors and troubleshoot any potential problems before they occur.
If you would prefer to just put the code in yourself, right click on the sheet tab that you want the code to be applied to (ie, Sheet1). One of the options should be View Code. Once you click that, the VBE will open up and a dialog box will have the focus. Simply copy and paste my code into the dialog box.
Let me know if it works.
How do I apply the code to the specific cell or cells that I want the sum in?
For example I need to be able to put 8 in A1, 7 in A2 and have the total of 15 in A3. I then need to be able to go back and delete the 8 and the 7 and have the total in A3 remain 15. Then I need to be able to put a 7 in A1 an 8 in A2 and have the total in A3 be 30.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks