A.Range(A2 & Lrow).Copy B.Cells(Rows.Count, "A").End(xlUp).Offset(1, 1)
A.Cells(1,1).Copy B.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
This is the code which copies the First heading and its corresponding Column
Sheet A Code Output
Male Female Male Mike
Mike Rose Female John
John Kat Bob
Bob Lisa Rose
Kat
Lisa
Expected output
Male Mike Male Mike
John Male John
Bob OR Male Bob
Female Rose Female Rose
Kat Female Kat
Lisa Female Lisa
Let me explain: When I use the normal code that I use everytime for copy paste, I get Male and Female in consecutive Rows which is wrong as Female should start from Rose . I see that the only problem can be that the range I am using to offset the first column is found by going up, so compiler will go up till 2nd row in first while I want it to go till the last value in column B. Is any of this output possible ?
B.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
This is what I need to change I think But need help. Thanks.
Aucun commentaire:
Enregistrer un commentaire