I've built a MASSIVE Excel macro for one of our ICP-MS instruments. The very last part of the app is a reporting function, and the last piece of THAT is to search a column that has LIMS record numbers in it and create a comma-separated list of the distinct LIMS numbers. The problem is that when I run the following line of code against the following values, it returns the following values.
Cell Value B13 205463 B14 205463 B15 205463 B16 205463 B17 205463 B18 205463 B19 206121 B20 206121 B21 206121 B22 206121 B23 206121
returns
Cell Value AA6 205463 AA7 205463 AA8 206121
when I run the following code
VB:
Sub TryAgain()
Range("B13:B23").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("AA6"), Unique:=True
End Sub
If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines
I am at a LOSS! No matter what I do, the code returns two instances of whatever the first value is that it finds more than one instance of. If I switch the 206121 values with the 205463 values, and put the 206121 values at the top, the code returns 206121, 206121 and 205462. Can ANYONE tell me what I'm doing wrong? I've cleared the cells and manually entered values to make sure there is not a stray space or other character that IS making two values distinct that appear to be identical...completely baffled on this one. BTW, if I replace the first value (cell B13) with a null, the function returns nothing. If instead I replace the SECOND value with qa null, I get
205463
205463
206121
(The second cell down is null)
ANY suggestions?