View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
J.W. Aldridge J.W. Aldridge is offline
external usenet poster
 
Posts: 425
Default Add code to paste data to next available row

Code works fine....
Just want to ammend code to paste on next available row on "Data"
sheet.
....starting in column A.

Sub ABC()
Dim cell As Range, c As Range
Dim i As Range, rw As Long
Dim sh As Worksheet
With Worksheets("List")
Set c = .Range(.Cells(6, "B"), .Cells(6, "B").End(xlDown))
Set i = .Range(.Cells(6, "I"), .Cells(6, "I").End(xlDown))
End With
rw = 2

Set sh = Worksheets("Data")
For Each cell In c
If Application.CountIf(i, cell) 0 Then
Range(cell, Cells(cell.Row, "G")).Copy sh.Cells(rw, 1)
rw = rw + 1
End If
Next
End Sub