Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using multiple user forms to perform Calculations

Very new to VBA but I will try to explain and be as brief as possible.
Using Excel 10 (2002) I am trying to use two user forms one to have th
user enter parameter needed and the other to return the calculate
results.
The first form is as follows;
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub CommandButton1_Click()
Call fmberesults.Show
End Sub
Private Sub SpinButton1_Change()
tbsplit.Text = SpinButton1.Value
End Sub
Private Sub SpinButton2_Change()
tbwab_rt.Text = SpinButton2.Value
End Sub
Private Sub SpinButton3_Change()
tbWaa_Rt.Text = SpinButton3.Value
End Sub
Private Sub SpinButton4_Change()
tbPov_Meas.Text = SpinButton4.Value
End Sub
Private Sub tbPov_meas_change()
NewVal = Val(tbPov_Meas.Text)
If NewVal = SpinButton4.Min And NewVal <= SpinButton4.Max The
SpinButton4.Value = NewVal
End Sub
Private Sub tbwaa_rt_change()
NewVal = Val(tbWaa_Rt.Text)
If NewVal = SpinButton3.Min And NewVal <= SpinButton3.Max The
SpinButton3.Value = NewVal
End Sub
Private Sub tbwab_rt_change()
NewVal = Val(tbwab_rt.Text)
If NewVal = SpinButton2.Min And NewVal <= SpinButton2.Max The
SpinButton2.Value = NewVal
End Sub
Private Sub tbsplit_change()
NewVal = Val(tbsplit.Text)
If NewVal = SpinButton1.Min And NewVal <= SpinButton1.Max The
SpinButton1.Value = NewVal
End Sub

I was able to test within this userform and got it to returnthe correc
answer to this;


'Sub tbdiscount_Change()
'Call Results
'End Sub

'Sub tbPtr_fl_Change()
'Call Results
'End Sub

'Sub Results()
' On Error Resume Next
' Dim Ptr_flinput As Currency
' Ptr_flinput = tbPtr_fl.Value
'Dim discountinput As Currency
' discountinput = tbdiscount.Value
'Dim Testinput As Currency
' Testinput = tbTest.Value(Round(2))

' tbTest.Value = "$" & (Ptr_flinput - discountinput)

'End Sub

The problem is after the user enters the data I have a "calculate
button that launches the second form;

"Private Sub CommandButton1_Click()
Call fmberesults.Show
End Sub"

But I do not know how to link the listbox that should contain th
answer to the first user form and perform the calculation that was don
sucessfully within the original user form. I believe I need to have th
Sub out in a module instead of in a private sub but any direction woul
be appreciated.

This is the code for the second form;
Sub Results()
On Error Resume Next
Dim Ptr_flinput As Currency
Ptr_flinput = tbPtr_fl.Value
Dim discountinput As Currency
discountinput = tbdiscount.Value
Dim disptrinput As Currency
disptrinput = tbdisptr.Value(Round(2))

tbdisptr.Value = "$" & (Ptr_flinput - discountinput)

End Sub



Private Sub CancelButton_Click()
Unload Me
Unload fmbetool
End Sub

Sorry for the long post but I wanted to be clear, not sure if it wa
but I tried

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using multiple user forms to perform Calculations

Nothing

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you perform calculations w/ cells that have both numbers and t BWP Excel Worksheet Functions 5 October 28th 08 01:18 PM
How can I perform calculations with hexadecimals Kingcop Excel Discussion (Misc queries) 1 November 6th 07 12:47 AM
perform calculations in 2 sheets Davidgg Excel Worksheet Functions 0 December 20th 06 03:39 PM
perform calculations using time arguments Derek Excel Worksheet Functions 2 May 20th 06 03:55 AM
Best technique to perform multiple calculations ? [email protected] Excel Worksheet Functions 5 January 25th 05 03:49 AM


All times are GMT +1. The time now is 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"