+ Reply to Thread
Results 1 to 2 of 2

Passing String Variable from Command Button Macro to a List Box in same User Form

  1. #1
    Registered User
    Join Date
    03-02-2008
    Posts
    39

    Passing String Variable from Command Button Macro to a List Box in same User Form

    I have a userform with a command buttion that opens a text file. The text file name is stored in a string variable. I would like to pass that string variable to a text box in the same userform. Any suggestions? Thansk in advance.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Passing String Variable from Command Button Macro to a List Box in same User Form

    Good afternoon wz4np1

    Just make sure that your variables are Dimmed, and the Dim statement is the first line in the module containing your userform code, ie., not in any of the routines.
    The variable, once given a value, will then be accessible to all controls on the form.

    HTH

    DominicB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1