Closed Thread
Results 1 to 4 of 4

Volume Calculator - Button

  1. #1
    SteveT
    Guest

    Volume Calculator - Button

    Help with pop up window/2nd sheet within workbook

    I would like for a rate calculator I've put together in Sheet 2 to pop up
    when button clicked Sheet 1. After the dimensions are keyed in, I would
    like the calculated figure to populate a cell with-in Sheet 1 when button to
    return to Sheet 1 clicked.

    1 issue is I would like the user to have the option of keying in directly to
    figure if already known or have the calculated figure from Sheet 2 populate
    upon return.

    This figure is the base for other calculations with in Sheet 1.

    (Minimum experience with Macros/Visual Basic - Mainly 'Macro Recorder')

    Your trusted assistance greatly appreciated.

    Steven


  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    Do you have to use sheet two? how many variables are you playing with?

    this might be something you can use Input box...
    Google is your best friend!

  3. #3
    SteveT
    Guest

    Re: Volume Calculator - Button

    Bearacade,

    No unless functional restrictions prevent.
    Multitude of calculcultaions performed to produce desired result.

    Variables though limited to 3 items



    "Bearacade" wrote:

    >
    > Do you have to use sheet two? how many variables are you playing with?
    >
    > this might be something you can use Input box...
    >
    >
    > --
    > Bearacade
    >
    >
    > ------------------------------------------------------------------------
    > Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
    > View this thread: http://www.excelforum.com/showthread...hreadid=556231
    >
    >


  4. #4
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    I think from what you are saying that 3 variable must be entered for the calcuation... So let's see if this will help you..

    Private Sub CommandButton1_Click()

    Dim L As Integer
    Dim H As Integer
    Dim W As Integer

    L = InputBox("Please enter the Length:", "Prompt for Length")
    H = InputBox("Please enter the Height:", "Prompt for Height")
    W = InputBox("Please enter the Width:", "Prompt for Width")

    Sheets("Sheet2").Range("A1") = L
    Sheets("Sheet2").Range("A2") = H
    Sheets("Sheet2").Range("A3") = W

    Range("A1") = L * H * W

    End Sub


    This will make it so that once someone clicks on the button, it will prompt you for the 3 variables, populate the cells in Sheet2, calculate the volumn and enter it in Sheet 1

    If you don't need to populate the cells in sheet2, delete those three lines.

    and check the Cells as you need

Closed 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