![]() ![]() ![]() 'load the active area of the sheet into the array r (highly recommend to get familiar with the terms UsedRange and CurrentRegion) ' Declare r as Variant, d as Variant, i as Long, lr as Long, f as Variant ![]() ' but it's better to give them longer and clearer names I often give variables short (one- and two-letter) names, ![]() I'll work with the code you provided ( but would greatly appreciate your help if you find the solution before I do In my real life application, I would like it to check if the value in Sheet1 (ws44), column B is present in Sheet2 (ws43) column C and only copy the row if the value is NOT present. With my new code, I notice that each time I run the macro, it copies the rows over, even though they already exist. Columns("E").Cells(.UsedRange.Rows(.).Row)).copy Destination:=nextcell.Offset(0, 4) Columns("C").Cells(.UsedRange.Rows(.).Row)).copy Destination:=nextcell.Offset(0, 2) Columns("A").Cells(.UsedRange.Rows(.).Row)).copy Destination:=nextcell 'Cells(r, col1.Column).Interior.Color = vbYellow If IsEmpty(cell) = True Then cell.Select: Exit For Lr = Columns("B:C").SpecialCells(xlCellTypeLastCell).Row ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |