+ Reply to Thread
Results 1 to 1 of 1

VBA loop to set variable based on table with matching name

  1. #1
    Registered User
    Join Date
    02-29-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    2

    VBA loop to set variable based on table with matching name

    Hello,

    I am probably doing this a very confusing and over complicated way for how it needs to be. But basically I am trying to reference a variable name in my code rather than the value of the variable.

    Basically a file that is loaded into this file can change, whether is columns added or removed, or simply just renamed. I have made a mapping table to some of the columns and if they were to be outputted or not along with the shortened column name (which name will not change). The idea is that if the column names were to change the rest of the code doesn't have to be amended as the shortened version will rename the same, i just need to update the long version on the mapping table.

    The code i am trying to do is:
    - To declare the shared variable
    - Then a routine is to be run which will then loop through the variables which i have listed in an array
    - If in a specific column contains that variable name, then the code will set the variable value as another column in that same row.

    I have attached an example of the code I am having issues with.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jabullen; 06-15-2020 at 10:30 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. Loop Through Variable Number of Pivot Table Series to change properties
    By alejosbat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2020, 10:44 AM
  2. [SOLVED] Sequential count based on matching variable...
    By blak9 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-12-2016, 10:33 AM
  3. finding the data in ta le 1 based on the user matching in table 2 VBA
    By prem pal singh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2014, 02:07 AM
  4. Replies: 8
    Last Post: 07-09-2014, 10:42 PM
  5. Replies: 5
    Last Post: 02-29-2012, 10:39 AM
  6. Sizing/creating an array based on a variable and a for loop
    By kyjocro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2011, 12:20 PM
  7. sum matching text value in table based on list
    By magowan in forum Excel General
    Replies: 5
    Last Post: 12-22-2010, 08:42 AM

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