Volume Calculator - Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Do you have to use sheet two? how many variables are you playing with?

this might be something you can use Input box..
 
Bearacade,

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

Variables though limited to 3 items
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top