Results 1 to 3 of 3

Thread: Parameters from Userform

  1. #1
    100 Club
    Join Date
    2007-07
    Posts
    104
    Login to Give a bone
    0

    Question Parameters from Userform

    Hi All

    What I am trying to achieve at the moment, is to use the number of the string in my combobox to calculate the attributes that are to be edited. But I don't know how to pass this number on to the sub in wich the attributes will be edited. Has anybody got any experience with this? Is it possible?

    Code:
     Public Sub UserForm_Initialize()
    
    Dim CBOarray As Variant
    Dim intIndex As Integer
    Dim CntCalc As Integer
    CBOarray = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")
    
    For intIndex = LBound(CBOarray) To UBound(CBOarray)
    Call Me.cboscript.AddItem(CBOarray(intIndex))
    CntCalc = intIndex * 4
    Next intIndex
    
    End Sub

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Parameters from Userform

    What I usually do is to make the variable you want to expose, a property of the form. Then, instead of the form's Close button unloading the form, you hide it. At that point control passes from the form to the calling sub, where you can access the form's property. Then you unload the form.
    C:> ED WORKING....


    LinkedIn

  3. #3
    100 Club
    Join Date
    2007-07
    Posts
    104
    Login to Give a bone
    0

    Default Re: Parameters from Userform

    Thanks, that got me where I needed to be. No parameters required.

Similar Threads

  1. Unload a userform
    By mikeosborne in forum VBA/COM Interop
    Replies: 2
    Last Post: 2009-09-28, 08:35 PM
  2. All I want is a Userform to show..
    By Coolmo in forum Dot Net API
    Replies: 5
    Last Post: 2009-07-23, 02:03 PM
  3. VBA userform in excel
    By Streng in forum VBA/COM Interop
    Replies: 3
    Last Post: 2009-02-17, 07:02 PM
  4. Userform limit
    By Coolmo in forum VBA/COM Interop
    Replies: 8
    Last Post: 2007-06-22, 06:29 PM
  5. Userform sizing
    By Coolmo in forum VBA/COM Interop
    Replies: 7
    Last Post: 2006-05-30, 11:30 PM

Posting Permissions

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