+ Reply to Thread
Results 1 to 5 of 5

passing variable values

  1. #1
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    passing variable values

    Hi there

    I have 2 variables cust and twopn that I first read the values in the code for the button tags (comes from the DB sheet) on the template worksheet.

    I need that data when I click the buttom MAKE PROOF from the user form. My issue is that I can not get the values to pass through to cmdProof code or I get complie error .

    Not sure what i am doing incorrectly. I tried useing PUBLIC for teh variables but it wont pass that way either.

    Thanks spo much for the help in advance. I am sure it is easy, I just am not sure what needs to be done as I am learning as I go.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: passing variable values

    Hmmm, I don't think you can call a sub that is part of a userform code from outside the form?

    If you move the cmdproof sub to a module, and have it load or show the userform first, then the sub can still run.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: passing variable values

    Quote Originally Posted by Arkadi View Post
    Hmmm, I don't think you can call a sub that is part of a userform code from outside the form?

    If you move the cmdproof sub to a module, and have it load or show the userform first, then the sub can still run.
    Not sure how to move the sub from the userform. This sub will execute once the MAKE PROOF button is clicked. It will be the same with the MAKE PALLET TAGS and PRINT EXTRA. They are all after data is placed into userform and a decision is made what is needed.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: passing variable values

    As I look closer, I assume your first issue is the error message that comes up as soon as you press the button on the template sheet? You cannot name a sub the same as an object on the form, and there is a button called cmdProof as well as a sub in the form.

  5. #5
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: passing variable values

    Thanks. I have figured it out! Appriciate it

+ 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. [SOLVED] Passing a variable from one Sub to another
    By Magnus360x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2014, 04:12 PM
  2. Passing Variable from one sub to another
    By bbmak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-27-2014, 12:39 PM
  3. passing variable name...
    By zara_toustra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2013, 01:15 PM
  4. Passing a variable from one sub to another sub
    By NRMDU in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 04:45 PM
  5. Replies: 1
    Last Post: 06-01-2011, 03:30 AM
  6. passing variable?
    By leroiv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2008, 10:52 AM
  7. [SOLVED] Passing variable to VarType of other Variable
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2005, 10:06 AM

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