Bize
Mechanical
- Jun 26, 2000
- 16
If you don't know how to do any of the following steps, we'll talk about it on the Forum.<br><br>1) In Excel, give names to all of your input and output<br> cells.<br>2) Make the "Control Toolbox" toolbar visible (View, <br> Toolbars)<br>3) Click on the "Button button" (fourth down, first column)<br> and draw one somewhere on the worksheet just as you <br> would draw any graphic. <br>4) RIGHT click on the new button and choose "View Code"<br>5) A whole new kind of screen shows up (To return to Excel,<br> press click the Excel button on the upper lefthand <br> corner of the screen.)<br>6) Your program will be between the lines that say<br> "Private Sub CommandButton1_Click()" and "End Sub"<br>7) Assume you named an input cell on your<br> worksheet "Height" and another one "Radius." If you<br> type H = [Height] and R =[Radius] as your first two <br> lines in you program then you can write a program just<br> as you would in Fortran or Basic. For instance <br> V = H * R * R * 3.14159<br>8) Assume you named a cell "Volume" on your worksheet. Then<br> to print the results above to the worksheet, add the<br> line [Volume] = V to your program.<br>9) Return to the worksheet (by pressing the Excel button on<br> the upper lefthand corner)<br>10) MOST IMPORTANT Get out of the "design mode" by pressing<br> the button with a blue triangle on it that is located<br> at the top of the Control Toolbox toolbar.<br>11) When you click on your new button, it should take the<br> input from the named cells on the worksheet and output<br> the results to the named cells on the worksheet<br>