PDA

View Full Version : Solved: How to get data from UserForm2 into UserForm1?



kinderjane
11-14-2012, 01:03 AM
I am trying to get the data that a user inputted into a second userform
(Vb = txtVb.Value)

So that I can use variable Vb for calculations in UserForm1.

Please help!

Part of UserForm2:
Public Sub cmdEnterCond_Click()
Dim CheckThisVb, CheckThisOpRatio As Boolean
Dim Vb, OpRatio As Variant

Vb = txtVb.Value
OpRatio = txtOpRatio.Value


Part of UserForm1 that uses variable in 2:
Public Sub cmdCalc_Click()
Dim Nmin, B, D, V, yInt, Rmin As Variant

Nmin = Log(((xD / (1 - xD)) * ((1 - xB) / xB)) / Log(RelVol))

B = F * (z - xD) / (xD + xB)

D = F + B

V = Vb * B

Bob Phillips
11-14-2012, 02:16 AM
Simplest way, declare them as public variables in a standard code module.