Hi Guys,
Need help with the below. I want to append my initial list from "Final" Sheet but if the same details already exist, I want it to just move to the next.
So it is like, I have a concatenate of Class, Name and Age in one sheet, and I have the same concatenate to another sheet.
My code is really messy, TIA!!!
Need help with the below. I want to append my initial list from "Final" Sheet but if the same details already exist, I want it to just move to the next.
So it is like, I have a concatenate of Class, Name and Age in one sheet, and I have the same concatenate to another sheet.
My code is really messy, TIA!!!
HTML:
Sub Append()
Dim LastRow As Integer
Dim LastRow2 As Integer
Dim Class, Name, Age, Multirange As Range
Dim Class2, Name2, Age2, Multirange2 As Range
Dim CL As Range
Dim Rng As Range
Sheets("Sheet1").Select
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Set Class = Range("B2:B" & LastRow)
Set Name = Range("D2:D" & LastRow)
Set Age = Range("F2:F" & LastRow)
Set Multirange = Union(Fund, TID, Forward_Date)
Set Class2 = Sheets("Computation").Range("A2:A" & LastRow)
Set Name2 = Sheets("Computation").Range("B2:B" & LastRow)
Set Age2 = Sheets("Computation").Range("C2:C" & LastRow)
Set Multirange2 = Union(Fund, TID, Forward_Date)
For Each CL In Multirange
If Not CL.Value = Multirange2 Then
If Rng Is Nothing Then
Set Rng = CL
Else
Set Rng = Union(Rng, CL)
End If
End If
Next CL
If Not Rng Is Nothing Then Rng.Copy
Sheets("Final").Select
Range("A" & Rows.Count).Select
ActiveCell.End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End Sub