logandiana
Board Regular
- Joined
- Feb 21, 2017
- Messages
- 107
Last week a posted a message to the board.
In which I was trying to use application.match to use header string to identify which columns needed to be used.
I tried several different variations of code and got similar results, some values just wouldn't be found while others would.
I thought I'd just approach this from an easier approach to see if I could identify what is going on and then go from there.
In cell A1 I have the text "Logical Partner"
In cell B1 I have the text "Sequence"
Now for a simple formula in cell A3. =match(A1,A1:B1,0) The result I get is 1, okay good that's what I was expecting.
Now, same formula only this time replace A1 in the formula with actual text, =match("Logical Partner",A1:B1,0) , should still be 1 right? I get #N/A!!!!
Let's try simpler. In A2 I type "Logical Partner" and the formula I enter now is =A1=A2 The result TRUE, okay good that's what I was expecting again
Now I change the formula to =A1="Logical Partner" aaaaaannndddd… FALSE!
Just like the link above from the other day, it doesn't happen in every column. For instance in cell F1 I have "Division", and everything works as expected.
I can't figure this one out. I have tried starting over thinking my workbook was corrupt. I've tried trim() and clean() thinking I was missing some missing characters. All the results are still the same.
Is there some bank of word strings that you are not supposed to lookup?
VBA Application.Match keeps throwing 2042 error
I have to fill columns of a template using column heading names, because sometimes the template shifts and the columns move. I have to find which column is correct before adding the data under the header. I am using the following code, and I keep getting ERROR 2042, but I am only getting the...
www.mrexcel.com
In which I was trying to use application.match to use header string to identify which columns needed to be used.
I tried several different variations of code and got similar results, some values just wouldn't be found while others would.
I thought I'd just approach this from an easier approach to see if I could identify what is going on and then go from there.
In cell A1 I have the text "Logical Partner"
In cell B1 I have the text "Sequence"
Now for a simple formula in cell A3. =match(A1,A1:B1,0) The result I get is 1, okay good that's what I was expecting.
Now, same formula only this time replace A1 in the formula with actual text, =match("Logical Partner",A1:B1,0) , should still be 1 right? I get #N/A!!!!
Let's try simpler. In A2 I type "Logical Partner" and the formula I enter now is =A1=A2 The result TRUE, okay good that's what I was expecting again
Now I change the formula to =A1="Logical Partner" aaaaaannndddd… FALSE!
Just like the link above from the other day, it doesn't happen in every column. For instance in cell F1 I have "Division", and everything works as expected.
I can't figure this one out. I have tried starting over thinking my workbook was corrupt. I've tried trim() and clean() thinking I was missing some missing characters. All the results are still the same.
Is there some bank of word strings that you are not supposed to lookup?