+ Reply to Thread
Results 1 to 2 of 2

help passing textbox value from user form to variable

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    help passing textbox value from user form to variable

    I am using the below code in the ThisWorkbook (Code) sheet to prompt for a pass phrase when the book is opened.
    Please Login or Register  to view this content.
    and passing the rspn to
    Please Login or Register  to view this content.
    I would like to use a user form so that I can hide the pass phrase that is typed in a text box and then pass that back to the ThisWorkbook (Code) as a varible to to verified by the below code.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: help passing textbox value from user form to variable

    create your form with a textbox and an OK button, in the OK button put your code

    alternatively create the form and have the OK button call the Sub in ThisWorkbook, you can either store the value in a Public variable (declare it in Module 1), store the result of the textbox in a cell in the workbook and refer to that in the code or (I think the sensible one), pass the text into the Sub ie the code for the button is

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. First User Form needs help with using textbox input a variable in vba Macro
    By capson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2015, 10:34 PM
  2. Passing values to a second user form.
    By Coleman34 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2014, 11:24 AM
  3. Passing Values from User Form
    By srinivassurapareddi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2012, 01:49 PM
  4. Passing String Variable from Command Button Macro to a List Box in same User Form
    By wz4np1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2012, 11:31 AM
  5. Passing inputs from one user form to another
    By daymaker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-18-2011, 11:02 AM
  6. Passing variables from sub to user form
    By boc_est1986 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-18-2009, 09:09 AM
  7. [SOLVED] User Form value passing problem
    By brusk2@uiuc.edu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2006, 12:24 PM

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