Hello everyone,
I am trying to write a macro that will first find what row number of a worksheet contains the column headers of some data, then searches that row for specific column names. In the long run, I plan to do it by using some kind of loop that will, using MATCH, search column A for every possible column header until it finds one.
For now, I am just trying to use the MATCH function to search for one particular column header. I have a variable set equal to the MATCH function. My problem is that I keep getting error 2042 as the value of the variable, even though the header I am searching for is in column A of the worksheet I'm searching. I'm hoping that I'm just making some stupid syntax error, and that one of you might be able to see what it is.
Here is just the relevant line:
Thanks in advance!
Here's my entire module, in case anyone actually wants to see it:
Bookmarks