+ Reply to Thread
Results 1 to 4 of 4

How to input a vba calculated value

  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    Russellville, KY
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to input a vba calculated value

    I am new to VBA so this will probably be a very simple question. I have 3 columns that will have data entered into them (an operator will input 3 lengths, one into each column). This data will change frequently. I have a calculation that will be run each time new data is entered. However, I only want the calculation to run when a command button is pushed and want the answer to be inserted into certain cell. The reason behind this is we want to keep the previous calculation from being accidentally erased. The idea is that you can change the data but a new answer will only be displayed if the command button (labeled CALCULATE) is clicked.

    Any help for a newbie would be great. I don't have to use VBA much, and when I do, it's for simple items like this. Any help would be great. Thanks,
    Last edited by mjseibert; 07-26-2012 at 04:16 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: New to VBA

    This will turn calculation in the book off and then only calc when the button is clicked. It will take a bit more doing to decide where to place results, so I need a bit more information for that part.
    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    07-14-2011
    Location
    Russellville, KY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: New to VBA

    Thanks for the reply. Here is more infomation. I am inputing my 3 data points in A4, B4, and C4. The solution will be updated in merged cell. The cells being merged are A20:D22. Let me know what other info you need.

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: How to input a vba calculated value

    Does the merged range A20:D22 contain a formula such as =SUM(A4,B4,C4) or =A4*B4*C4 or will it be the result of some calculation based on the 3 lenghts put in and you want the macro to handle the results. Is this like a quiz/math drill and you have students who have to make guesses at the answer?

+ 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