Copy list from one Wkbk and paste into another Wkbk

I'm trying to copy a list from one work book and paste it into the first free cell in a column of another workbook. There seems to be something wrong with the code for pasting the list.

Private Sub OK_Click()
Dim i As Long, msg As String
Dim c As Long, d As Long, e As Long
Dim Counter As Integer

c = 0
e = ActiveCell.Column
d = 0

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
'Paste Selection
ActiveCell.Offset(2, 0) = .List(i)
'Get Details of ListBox Selection from Database.xls to paste in Sample Facilties Systems.xls
For Counter = 1 To 20
Workbooks("Database.xls").Sheets(e).Cells(Counter, i + 1).Copy
ActiveSheet.Cells(0, e).End(xlDown).Offset(1, 0).Paste
Application.CutCopyMode = False
Next Counter
End If
Next i
End With
Unload Me
End Sub

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!