Consulting

Results 1 to 3 of 3

Thread: Is this possible in VBA ????? ( rexx interpret command)

  1. #1
    VBAX Regular
    Joined
    Feb 2009
    Posts
    55
    Location

    Is this possible in VBA ????? ( rexx interpret command)

    Hi

    can this be done in VBA ? -

    a = "myname"
    value of a = "bbb"

    debug.print myname ==>>> will print "bbb"

    ============================================


    For those who are familiar with rexx interpret command it is obvious

    For those who are not my question is:


    is it possible to assign a value to VBA variable whose name is stored in another variable ?



    thanks for your help

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Typically, no, but if the variable is declared in an object module, then you can use CallByName to, well, call it by name.
    Be as you wish to seem

  3. #3
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    You can refer to objects in a collection by name.
    Dim col As New Collection
    ...
    col.Add New Class1, "myname"
    col("myname").Value = "aaa"
    Debug.Print col("myname").Value

Posting Permissions

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