The problem seems to be with the line
rowCount = R1C2.Count.End(xlUp)
I do not know what this is supposed to do but, whatever, it does not do it.
Also
Set rng = Range("B1:RowCount")
Will not work because range needs one or two cell addresses and "RowCount" is
a long, i.e.a number not an address.