Combining two columns in Excel into a "virtual helper column" using VBA -
i have 2 columns combine third helper column concatening them.
one 4-digit column, other single digit.
for instance:
columna columnb columnc 1234 1 12341 1234 1 12341 1234 2 12342 2345 1 23451 2345 2 23452 2345 2 23452
i run array formula in 4th column (using identifier in each row) indicates how many unique values there column c each identifier.
i circumvent use of helper column if possible -- building range (in numerical format) in vba can reference in code can away helper column.
hopefully makes sense , have idea how it.
thanks in advance.
edit: sorry -- based on useful answer provided santosh below (which can use on problem have), i've realised haven't explained myself.
each row has identifier (shown here column_ident)
columna columnb columnc column_ident 1234 1 12341 555 1234 1 12341 555 1234 2 12342 555 2345 1 23451 666 2345 2 23452 666 2345 2 23452 666
i make table -- using array formula (based on frequency function) -- shows each unique identifier (in case 555 , 666) how many unique values occur concatenated column c. so, here 2 555 , 2 666).
i end report this:
ident unique_count 555 2 666 2
what i'm trying code rid of need helper columnc in original table , still allow me achieve same result in second table.
again, in advance.
try below code.
sub sample() dim lastrow long sheets("sheet1") lastrow = .range("a" & .rows.count).end(xlup).row .range("a1:b" & lastrow).removeduplicates columns:=array(1, 2), header:=xlyes end end sub
Comments
Post a Comment