I am trying to copy and paste to a different sheet, and need to paste the rows starting in column C rather than Column A.
THe VBA is for a Copy Unique rows. Works great but need to post in Column C of "Check List" rather than Column A. Don't need to copy the entire row, just out to Column BB. New to VBA.
Option Explicit
Sub CopyAndRemoveDups()
Dim cl As Range
Dim ws As Worksheet
Dim x As Long
Dim LastRow As Long
Dim rng As Range
Dim rngToDelete As Range
Set ws = Worksheets("query")
With ws
For Each cl In .Range("A1:A" & .Range("A65536").End(xlUp).Row)
If cl.Value <> "" Then
cl.EntireRow.Copy Worksheets("Check List").Range("A65536").End(xlUp).Offset(1, 0)
End If
Next cl
End With
Set ws = Worksheets("Check List")
'Advanced Filter requires a header row- let's add a temporary one
ws.Rows(1).Insert
ws.Cells(1, 1).Value = "temp header"
'Set Filter column
Set rng = ws.Range("D1:D10000")
rng.AdvancedFilter xlFilterInPlace, Unique:=True
Set rngToDelete = rng.SpecialCells(xlCellTypeVisible)
ws.ShowAllData
rngToDelete.EntireRow.Hidden = True
rng.SpecialCells(xlCellTypeVisible).EntireRow.Delete
rngToDelete.EntireRow.Hidden = False
'remove the temporary row
ws.Rows(1).Delete
End Sub
Thank you for your help
Bookmarks