+ Reply to Thread
Results 1 to 12 of 12

Adding up in Excel.

Hybrid View

loekie Adding up in Excel. 03-26-2011, 07:23 AM
Richard Buttrey Re: Adding up in Excel. 03-26-2011, 07:34 AM
loekie Re: Adding up in Excel. 03-26-2011, 09:31 AM
martindwilson Re: Adding up in Excel. 03-26-2011, 09:45 AM
loekie Re: Adding up in Excel. 03-26-2011, 10:03 AM
TMS Re: Adding up in Excel. 03-26-2011, 10:18 AM
rachelherner Re: Adding up in Excel. 08-21-2013, 11:25 AM
heshopesho Re: Adding up in Excel. 12-16-2021, 01:55 PM
loekie Re: Adding up in Excel. 03-26-2011, 10:41 AM
frenzynator Re: Adding up in Excel. 04-13-2011, 02:00 AM
TMS Re: Adding up in Excel. 04-13-2011, 02:42 AM
6StringJazzer Re: Adding up in Excel. 12-18-2021, 10:57 PM
  1. #1
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding up in Excel.

    Hello Lukas,

    You can't do this with a formula, but you can do it with a macro. Specifically the Sheet Change event. i.e.

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Not Intersect(Target, Range("B1")) Is Nothing Then
            Range("A1") = Range("A1") + Range("B1")
            Application.EnableEvents = False
            Range("B1") = ""
            Application.EnableEvents = True
        End If
    End Sub
    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  2. #2
    Registered User
    Join Date
    03-20-2011
    Location
    South-Africa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Adding up in Excel.

    I don't know if I am doing something stupid, but I can't get the macro to run. It looks like something is missing. As soon as I run the macro I get a "Runtime 424' error. Object required" This is what I got in the macro.
    Sub Worksheet_Change()
    If Not Intersect(Target, Range("B1")) Is Nothing Then
            Range("A1") = Range("A1") + Range("B1")
                    Application.EnableEvents = False
            Range("B1") = ""
            Application.EnableEvents = True
        End If
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1