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.![]()
Bookmarks