A newbie question Forms - Input and Output from an Excel Worksheet
I need to use a simple form to input data. The data input goes on to
do some calculations.I would like the resulting calculations to appear on the form. For example: Data input in Form: Cost of Handset: $300, Margin: 50%, Lease period: 3 years. Calculations ( either in form or in worksheet): 1.Selling Price = Cost *(1+margin) 2.Lease Cost = PMT(7%,Lease Period*12,-Selling Price) Information required as output on Form: Lease Cost I did try a couple of books like the Walkenbach one but could not find how to send the information back from the wroksheet to the form. Also, how do I disable users form scrolling off the on-screen form. Windows Freeze pane does not seem to work across computers. Moreover, that is not covered by Protect Sheet or Protect Workbook. Could some one please help me or point me to a link where I can find the relevant information. Thanks in advance, |
A newbie question Forms - Input and Output from an Excel Worksheet
2 Options
put 3 text boxes 2 labels and 1 command button on your form Textbox1 =Cost of Handse Textbox2=Margin (as whole number Textbox3=Lease perio Label1= Selling Pric Label2= Lease Cos CmdBtn1= Calculat in the click event of CmdBtn1 put this Private sub CmdBtn1_Click( Label1.caption = CvLong(textbox1.text) *(1 + CvLong(textbox2.text/100) Label2.caption = PMT(7,cvlong(textbox3.text)*12,-cvlong(label1.caption)) <= I just followed what u ha End sub OR You could also disregard the 3 textboxes and pull from the cells using Private sub CmdBtn1_Click( dim t1 as long, t2 as long, t3 as lntege t1 = Range("A1" t2= Range("A2" t3= Range("A3" Label1.caption = CvLong(t1) *(1 + CvLong(t2/100) Label2.caption = PMT(7,cvlong(t3)*12,-cvlong(label1.caption)) <= I just followed what u ha End sub ----- NewRipper wrote: ---- I need to use a simple form to input data. The data input goes on t do some calculations.I would like the resulting calculations to appea on the form For example: Data input in Form: Cost of Handset: $300, Margin: 50%, Lease period 3 years Calculations ( either in form or in worksheet): 1.Selling Price = Cost *(1+margin 2.Lease Cost = PMT(7%,Lease Period*12,-Selling Price Information required as output on Form: Lease Cos I did try a couple of books like the Walkenbach one but could not fin how to send the information back from the wroksheet to the form Also, how do I disable users form scrolling off the on-screen form Windows Freeze pane does not seem to work across computers. Moreover that is not covered by Protect Sheet or Protect Workbook Could some one please help me or point me to a link where I can fin the relevant information Thanks in advance |
A newbie question Forms - Input and Output from an Excel Worksheet
----- chris wrote: ---- 2 Options put 3 text boxes 2 labels and 1 command button on your form Textbox1 =Cost of Handse Textbox2=Margin (as whole number Textbox3=Lease perio Label1= Selling Pric Label2= Lease Cos CmdBtn1= Calculat in the click event of CmdBtn1 put this Private sub CmdBtn1_Click( Label1.caption = CvLong(textbox1.text) *(1 + CvLong(textbox2.text/100) Label2.caption = PMT(7,cvlong(textbox3.text)*12,-cvlong(label1.caption)) <= I just followed what u ha End sub OR You could also disregard the 3 textboxes and pull from the cells using Private sub CmdBtn1_Click( dim t1 as long, t2 as long, t3 as lntege t1 = Worksheets(ActiveSheet.Name).Range("A1" t2 = Worksheets(ActiveSheet.Name).Range("A2" t3 = Worksheets(ActiveSheet.Name).Range("A3" Label1.caption = CvLong(t1) *(1 + CvLong(t2/100) Label2.caption = PMT(7,cvlong(t3)*12,-cvlong(label1.caption)) <= I just followed what u ha End sub ----- NewRipper wrote: ---- I need to use a simple form to input data. The data input goes on t do some calculations.I would like the resulting calculations to appea on the form For example: Data input in Form: Cost of Handset: $300, Margin: 50%, Lease period 3 years Calculations ( either in form or in worksheet): 1.Selling Price = Cost *(1+margin 2.Lease Cost = PMT(7%,Lease Period*12,-Selling Price Information required as output on Form: Lease Cos I did try a couple of books like the Walkenbach one but could not fin how to send the information back from the wroksheet to the form Also, how do I disable users form scrolling off the on-screen form Windows Freeze pane does not seem to work across computers. Moreover that is not covered by Protect Sheet or Protect Workbook Could some one please help me or point me to a link where I can fin the relevant information Thanks in advance |
All times are GMT +1. The time now is 05:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com