+ Reply to Thread
Results 1 to 3 of 3

getting values of variable names defined within an array

  1. #1
    Registered User
    Join Date
    02-17-2019
    Location
    India
    MS-Off Ver
    2013
    Posts
    1

    getting values of variable names defined within an array

    Good Morning to all! Please go through the code. myarr is defined by two variable names var1 and var2. the values of var1, var2 are "value1" , "value2" respectively. when i try to print the values of these variables using loop it is giving blank. please try to help on this.
    Sub test()
    myarr = Array(var1, var2) 'Variables defined in an array
    var1 = "value1" 'Assigned values variable
    var2 = "value2" 'Assigned values variable
    For Each Val1 In myarr
    debug.print Val1 'print value of variable
    Next
    End Sub

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: getting values of variable names defined within an array

    May be this?

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: getting values of variable names defined within an array

    Hi Saggarla Murali,

    Welcome to the forum!!

    Here's a possibility:

    Please Login or Register  to view this content.
    Regards,

    Robert

    PS Please ensure you wrap any code you post with the appropriate tags like I have done. Thanks.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

+ 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] Variable Array Names
    By evertjvr in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-07-2015, 01:32 AM
  2. Replacing values in existing functions with newly defined names
    By scestes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2014, 05:48 AM
  3. Replies: 7
    Last Post: 10-26-2012, 03:19 PM
  4. Replies: 2
    Last Post: 03-12-2011, 04:07 AM
  5. String array values to array of User-Defined Types
    By rtiltins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2008, 07:45 AM
  6. [SOLVED] Clearing all values in a User Defined Type variable
    By J Streger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2006, 03:10 PM
  7. Replies: 2
    Last Post: 04-07-2005, 05:06 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