I've tried everything I can think of, and I'm stuck here. I've got this statement:
Counted = Application.WorksheetFunction.Match(BCC_Bin, Sheets("BCC_Counts").Range("A1", "A" & last_row_bcc), 1)
(Counted and last_row_bcc are both declared as integers). I'm working with a large dataset, and this formula only seems to work part of the time. In chunks. It's in a loop, and it will work fine for the first couple thousand passes, but then it will go through a couple hundred and return 0 every time. But when I set a break point and do:
debug.print Application.WorksheetFunction.Match(BCC_Bin, Sheets("BCC_Counts").Range("A1", "A" & last_row_bcc), 1)
I get the correct number returned, then I step through, and I get 0 again. I ensured that my source data is sorted in ascending order, and my range is getting the full range that I want. Calculationmode is set to automatic (though that shouldn't matter for VBA calculations, right?).
Any ideas?
Counted = Application.WorksheetFunction.Match(BCC_Bin, Sheets("BCC_Counts").Range("A1", "A" & last_row_bcc), 1)
(Counted and last_row_bcc are both declared as integers). I'm working with a large dataset, and this formula only seems to work part of the time. In chunks. It's in a loop, and it will work fine for the first couple thousand passes, but then it will go through a couple hundred and return 0 every time. But when I set a break point and do:
debug.print Application.WorksheetFunction.Match(BCC_Bin, Sheets("BCC_Counts").Range("A1", "A" & last_row_bcc), 1)
I get the correct number returned, then I step through, and I get 0 again. I ensured that my source data is sorted in ascending order, and my range is getting the full range that I want. Calculationmode is set to automatic (though that shouldn't matter for VBA calculations, right?).
Any ideas?