ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Volume Calculator - Button (https://www.excelbanter.com/excel-programming/365565-volume-calculator-button.html)

SteveT

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


Bearacade[_27_]

Volume Calculator - Button
 

Do you have to use sheet two? how many variables are you playing with?

this might be something you can use Input box..

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=55623


SteveT

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



Bearacade[_30_]

Volume Calculator - Button
 

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


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=556231



All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com