Results 1 to 10 of 11

Thread: Adding value of two cells to get result in 3rd cell

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    That macro is OK, if it works for you. It will recalculate everytime you select any cell anywhere in the worksheet. So it is a little inefficient, The macro will be run many times when it is not needed to run.

    This might be a bit better,
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Address = "$B$3" Or Target.Address = "$E$3" Then
      Let Application.EnableEvents = False
      Let Range("C8").Value = Range("B3").Value + Range("E3").Value
      Let Application.EnableEvents = True
     Else
     
     End If
     
    End Sub
    But you can use the one you prefer
    Last edited by DocAElstein; 08-26-2020 at 10:29 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

  2. #2
    Member
    Join Date
    May 2020
    Posts
    66
    Rep Power
    6
    Quote Originally Posted by DocAElstein View Post
    That macro is OK, if it works for you. It will recalculate everytime you select any cell anywhere in the worksheet. So it is a little inefficient, The macro will be run many times when it is not needed to run.

    This might be a bit better,
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Address = "$B$3" Or Target.Address = "$E$3" Then
      Let Application.EnableEvents = False
      Let Range("C8").Value = Range("B3").Value + Range("E3").Value
      Let Application.EnableEvents = True
     Else
     
     End If
     
    End Sub
    But you can use the one you prefer
    This code is really better and works nicely. This is what I wanted.
    The code may be a one minute play for some expert like you, but for mine, it may take several minutes to understand and several hours to build such codes independently.
    That's the reason I have to take help every time.

    Thank you for your time and effort for me!!

Similar Threads

  1. Replies: 3
    Last Post: 02-11-2014, 08:31 PM
  2. Replies: 2
    Last Post: 07-23-2013, 06:54 PM
  3. Adding specfic number to a available number in previous cell.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 2
    Last Post: 03-02-2013, 01:55 AM
  4. Replies: 2
    Last Post: 01-24-2013, 09:03 PM
  5. Trim Text after 3rd Underscore but retain format
    By trankim in forum Excel Help
    Replies: 4
    Last Post: 05-13-2012, 10:44 AM

Posting Permissions

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