I have a seemingly simple comparison that will only work part of the time. I have searched this and other forums and I just cant seem to find the issue. I'm using the following VBA code to compare and copy the value of the cell into the cell next to it if it matches. It is in a loop but the code on either side of this executes so there shouldn't be any reason for the if statement not to be evaluated.
The values for ActiveCell.Offset(0, -9) and whether or not they match are as follows:
10/0.0/0 Match
10/1.0/0 Match
10/2.0/0 Match
10/4.0/0 No Match
10/6.0/0 No Match
10/6.1/0 No Match
10/7.0/0 No Match
10/10.0/0 Match
10/11.0/0 Match
10/11.1/0 Match
10/12.0/0 Match
10/14.0/0 No Match
10/14.1/0 No Match
10/15.0/0 Match
From what I can tell there seem to be no rhyme or reason to it matching or not matching. Any help would be much appreciated.
Code:
If ActiveCell.Offset(0, -9).Value Like "*[10-20]/*[0-20].*[0-1]/0" Then ActiveCell.Offset(0, -8).Value = ActiveCell.Offset(0, -9).Value
The values for ActiveCell.Offset(0, -9) and whether or not they match are as follows:
10/0.0/0 Match
10/1.0/0 Match
10/2.0/0 Match
10/4.0/0 No Match
10/6.0/0 No Match
10/6.1/0 No Match
10/7.0/0 No Match
10/10.0/0 Match
10/11.0/0 Match
10/11.1/0 Match
10/12.0/0 Match
10/14.0/0 No Match
10/14.1/0 No Match
10/15.0/0 Match
From what I can tell there seem to be no rhyme or reason to it matching or not matching. Any help would be much appreciated.