Consulting

Results 1 to 2 of 2

Thread: Solved: How to get data from UserForm2 into UserForm1?

  1. #1

    Solved: How to get data from UserForm2 into UserForm1?

    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:
    [VBA]Public Sub cmdEnterCond_Click()
    Dim CheckThisVb, CheckThisOpRatio As Boolean
    Dim Vb, OpRatio As Variant

    Vb = txtVb.Value
    OpRatio = txtOpRatio.Value[/VBA]


    Part of UserForm1 that uses variable in 2:
    [VBA]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[/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Simplest way, declare them as public variables in a standard code module.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •