VBA--display a variable's contents if its name corresponds to the value in a cell
I'm trying to paste variable values into a spreadsheet. I want to select which variable's value to paste by whether or not the column heading (or text in a given cell) is the NAME of that variable.
So, for example:
Say there are three variables in a VBA subprocedure: Title, Amount, and Total--each of which have stored values.
In a worksheet, I have column headings entitled "Title" "Amount" and "Total" in say cells A1, B1, and C1, respectively.
In a VBA subprocedure, I want to systematically go through row 1, column by column, check the text/value of that row, and dynamically select the variable with the same name as the text/value of the cell in the header and paste its values below the header in row 2.
Maybe this is a bad setup, and I know this is unorthodox, but surely some cool Excel Guru knows how to solve this.
Re: VBA--display a variable's contents if its name corresponds to the value in a cell
Give us a sample workbook with a few sheets in it that explains the problem.
Is Sheet1 the place these values get transfered to?
Are all the numbers on Sheet2 directly below the words Title, Amount, Total?
Are there multiple rows that have Title, Amount, Total with numbers below them?
The code isn't that hard if you can show what your data looks like.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
- 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