PDA

View Full Version : VB copy & paste help .......pleased



KK1966
08-18-2008, 03:34 AM
Hi

Please help with copy external data VB codes as I want to call others xls. File worksheets sheet1 to copy from range A3 to count by blank, than paste it in to active WS range ?A? count by lastRow

Please help

KK1966
08-18-2008, 07:26 AM
Deae experts

Please help as I brian the code as below but it can't be work with prompt errors!!!!,
can u help me check or learn me which i made a wrong, pleased.

Sub SvLVLc()
Dim home As Worksheet
Dim Filename As String
Dim Wb As Workbook
Dim Range As Variant



With Application.FileDialog(msoFileDialogOpen)

Set home = ActiveWorkbook.ActiveSheet
.AllowMultiSelect = False
If .Show = -1 Then
Filename = .SelectedItems(1)
Set Wb = Workbooks.Open(Filename)
home.Cells(Rows.Count, "A").End(xlUp).Offset(1).PasteValues.Value = Wb.Worksheets("sheet1").Range("A3" & .Cells(.Rows.Count, "A").End(xlUp).Row).Copy


Wb.Close (False)

End If
End With
End Sub