+ Reply to Thread
Results 1 to 4 of 4

passing variable name...

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Québec
    MS-Off Ver
    Excel 2002
    Posts
    14

    passing variable name...

    Hello,

    In a userform, I've a code with a lots of public variable (bol_Descr1, bol_Descr2, bol_Descr3,...).
    In a public sub() I want to set this boolean to true when a specific condition occur (If str_Value <> "")


    Assuming that str_Temp contain a string with the name of the boolean I want change ("_Descr1" , or "_Descr2" or "_Descr3", is there a way to tel VBA something like

    Please Login or Register  to view this content.
    Thanks a lot

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: passing variable name...

    Is the code in the userform? If yes, you may use:
    Please Login or Register  to view this content.
    Last edited by Izandol; 12-18-2013 at 11:23 AM.

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: passing variable name...

    Would be easiest to make bol_Desc an array

    i.e.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-08-2013
    Location
    Québec
    MS-Off Ver
    Excel 2002
    Posts
    14

    Re: passing variable name...

    The CallByMe function was exactly what I need ! Many thanks

+ 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. 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
  2. passing variable from userform
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2010, 08:22 PM
  3. passing variable?
    By leroiv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2008, 10:52 AM
  4. [SOLVED] Passing variable to Access
    By Job in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2005, 11:05 AM
  5. [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