• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy 3 column of a table on sheet 1 to another table in sheet 2

Belleke

Active Member
Hi,
I have this code that works except that the data has to go in the table on sheet 2, this code puts the data under the table.
Code:
Private Sub Cmd_09_Click()
Set DT = Sheets("Data")
Set NB = Sheets("Nog te betalen")
On Error Resume Next
With DT
    ar = .Cells(1).CurrentRegion
    ReDim ar1(UBound(ar), 3)
    For s = 2 To UBound(ar)
    If ar(s, 12) <> "" Then
          ar1(t, 0) = ar(s, 1)
          ar1(t, 1) = ar(s, 3)
          ar1(t, 2) = ar(s, 12)
          t = t + 1
    End If
    Next s
NB.Cells(Rows.Count, "A").End(xlUp).Offset(1).Resize(UBound(ar1) + 1, UBound(ar1, 2) + 1) = ar1
End With
[wis_lst].ClearContents
End Sub
Thanks.
 
Top