Hi all!
I'm hoping that someone can provide some direction on a code I'm currently working on.
I have a workbook with multiple worksheets, and would like to compare Column "L" on the "TransitionGrid-Dish" worksheet to Column A in the "LikeProfiles" worksheet. If the Column L values on the first worksheet are not contained in Column A, I would like to be able to copy them to the next blank row in Column A on the second worksheet.
I've come up with the following code so far:
Can anyone please tell me if I'm on the right track?! I feel so close, but the code as written above doesn't execute any action. I would really, really appreciate any help anyone would be kind enough to offer!
Nikki
I'm hoping that someone can provide some direction on a code I'm currently working on.
I have a workbook with multiple worksheets, and would like to compare Column "L" on the "TransitionGrid-Dish" worksheet to Column A in the "LikeProfiles" worksheet. If the Column L values on the first worksheet are not contained in Column A, I would like to be able to copy them to the next blank row in Column A on the second worksheet.
I've come up with the following code so far:
Code:
Sub CompareandHardcode()
Dim ws As Worksheet
Dim wb As Workbook
Set wb = ActiveWorkbook
Set ws = wb.Worksheets(1)
i = 1
Do
If Sheets("TRANSITIONGRID-DISH").Cells(i, 12).Value = "" Then
Exit Do
End If
Set valFound = Sheets("LIKEPROFILES").Columns("A").Find(Sheets("TRANSITIONGRID-DISH").Cells(i, 12).Value, , , xlWhole)
If valFound Is Nothing Then
lastrow = Sheets("LIKEPROFILES").UsedRange.Rows.Count
Sheets("LIKEPROFILES").Range("A" & lastrow & ":A" & lastrow) = Sheets("TRANSITIONGRID-DISH").Range("L" & i & ":L" & i)
End If
i = i + 1
Loop
With ws
End With
End Sub
Can anyone please tell me if I'm on the right track?! I feel so close, but the code as written above doesn't execute any action. I would really, really appreciate any help anyone would be kind enough to offer!
Nikki
Last edited: