Hi all,
Have some VBA code that copies data from 1 list and then pastes any entries that don't already exist.
The issue that I have is that in column A the cells also has a hyperlink and some formatting.
Code is below if anyone is steer my in the right direction.
Cheers
Have some VBA code that copies data from 1 list and then pastes any entries that don't already exist.
The issue that I have is that in column A the cells also has a hyperlink and some formatting.
Code is below if anyone is steer my in the right direction.
Cheers
Code:
Sub CopyUnique()Dim sh1 As Worksheet, sh2 As Worksheet, lr As Long, rng As Range
Set sh1 = Sheet2
Set sh2 = Sheet1
lr = sh1.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh1.Range("A1:A" & lr)
For Each c In rng
If WorksheetFunction.CountIf(sh2.Range("A:A"), c.Value) = 0 Then
sh2.Range("A" & sh2.Cells(Rows.Count, 1).End(xlUp).Row)(2).Resize(1, 4) = c.Resize(1, 4).Value
End If
Next
End Su