+ Reply to Thread
Results 1 to 2 of 2

VBA variable name in array

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    Norway
    MS-Off Ver
    Excel 2013
    Posts
    34

    VBA variable name in array

    Hi all,

    Below is a snip from my code:

    Please Login or Register  to view this content.

    This code will give the variables Rader(1) = 50, Rader(2)=75, Rader(3)=119 etc.

    As the variables are used several places in my code, I would like to rename them to something more precise (ie Rader(1) should be "SD", Rader(2) should be "ED" etc), but at the same time keep the search for correct row in the loop.

    My attempt obviously fails:

    Please Login or Register  to view this content.
    Anyone have a suggestion on how to fix this?


    / Kim

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA variable name in array

    There's nothing to fix - that is how you refer to array variables but you could declare an enumeration with the names you want and refer to the Enum as the index of the array...

    Please Login or Register  to view this content.

    Other than declaring a variable named 'SD' and setting it equal to rader(1), that's probably the closest you'll get...
    Last edited by cytop; 06-20-2017 at 08:01 AM.

+ 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] Why can't I assign an array variable to an array function in my subroutine?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2017, 10:33 PM
  2. Replies: 5
    Last Post: 06-18-2015, 09:10 AM
  3. [SOLVED] Adding to a new variable array from an existing array
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-17-2014, 12:08 AM
  4. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  5. [SOLVED] Summing Array Variable by Another Value in the Array (VBA Code)
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-18-2013, 10:13 AM
  6. vlookup with variable range and variable array size
    By chaslie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2013, 02:37 PM
  7. Variable File Reference and Variable Table Array in VBA VLOOKUP
    By Gingeiko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2011, 11:08 PM

Tags for this Thread

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