Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:35:21+00:00 2026-06-17T10:35:21+00:00

I have calculated some values and there should be two results. I want to

  • 0

I have calculated some values and there should be two results. I want to display these result in two different cell.

When I have changed A1 or A2 value, excel is stopped. Is there anyway I can display the values?

Sheet1 
Private Sub Worksheet_Change(ByVal Target As Range)
   Call DisplayResult 
End Sub

Module1 
Sub DisplayResult() 
     Range("A3").Value = Range("A1").Select.Value + Range("A2").Select.Value     
     Range("B3").Value = Range("B1").Select.Value + Range("B2").Select.Value 
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:35:23+00:00Added an answer on June 17, 2026 at 10:35 am

    you don’t need to use .select at all here –

    Worksheet Code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Sheet1.Range("A1:B2"), Target) Is Nothing Then
        MsgBox "Hello"
    End If
    
    End Sub
    

    Module Code:

    Sub DisplayResult()
    
    Sheet1.Range("A3").Value = Sheet1.Range("A1").Value + Sheet1.Range("A2").Value
    Sheet1.Range("B3").Value = Sheet1.Range("B1").Value + Sheet1.Range("B2").Value
    
    End Sub
    

    If you put the Call DisplayResult line in your Worksheet_Change sub routine without limiting what range it should be triggered on, then it will end up going into an infinite loop (DisplayResult triggers the Worksheet_Change sub). When should the DisplayResult code be triggered? Only when you have changed Range A1:B2 ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two Activities. In one I calculate some things and therefore I have
I have an unbalanced quarterly panel data set with missing values. I want to
I want to pass my renderer some values from another class. After the renderer
I am using MvcMailer and trying to pass calculated values. These values are calculated
I have a function that calculates the left and right node values for some
I have some sql statements that calculates some numbers. It's possible (with bonus points/penalty
I have some jquery which will calculate the items in my menu and assign
I have a code that calculates heat transfer in some number of conductors. What
I have a code generating a timespan to calculate a duration of some action.
If one calculates the recommendations for a boolean DataModel, the RecommendedItems have some numbers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.