KK1966
06-27-2008, 08:09 AM
Dear Expert’s
Thanks all of your’s help I’m very much here’s, Below the code was learn form the forum to copy external workbook paste in a objects worksheets, Now I has a problem to want some help or learn me how to modify this module to a copy different range in the same worksheets like as,
Opening workbook “ copy to” Active worksheets
Range( C16 ) Column( B2 to Left count cells in blank )
Range( C17 ) Column( B6 to Left count cells in blank )
Range( C18 ) Column( B9 to Left count cells in blank )
Range( C19 ) Column( B12 to Left count cells in blank )
Range( C20 ) Column( B15 to Left count cells in blank )
Your help I highly appreciate
Sub testing()
Dim home As Worksheet
Dim FNname AsString
Dim Wb As Workbook
Dim Tgt As Range
Set home = ActiveSheet
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
If .Show = -1 Then
Set Tgt = home.Cells(2, Columns.Count).End(xlToLeft).Offset(, 1)
FName = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If FName <> FalseThen
Set Wb = Workbooks.Open(FName)
Wb.Worksheets("MAN_SUM").Range("H13:H16").Copy
Tgt.PasteSpecial xlPasteValues
Wb.Close False
EndIf
EndIf
End With
End Sub
Thanks all of your’s help I’m very much here’s, Below the code was learn form the forum to copy external workbook paste in a objects worksheets, Now I has a problem to want some help or learn me how to modify this module to a copy different range in the same worksheets like as,
Opening workbook “ copy to” Active worksheets
Range( C16 ) Column( B2 to Left count cells in blank )
Range( C17 ) Column( B6 to Left count cells in blank )
Range( C18 ) Column( B9 to Left count cells in blank )
Range( C19 ) Column( B12 to Left count cells in blank )
Range( C20 ) Column( B15 to Left count cells in blank )
Your help I highly appreciate
Sub testing()
Dim home As Worksheet
Dim FNname AsString
Dim Wb As Workbook
Dim Tgt As Range
Set home = ActiveSheet
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
If .Show = -1 Then
Set Tgt = home.Cells(2, Columns.Count).End(xlToLeft).Offset(, 1)
FName = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If FName <> FalseThen
Set Wb = Workbooks.Open(FName)
Wb.Worksheets("MAN_SUM").Range("H13:H16").Copy
Tgt.PasteSpecial xlPasteValues
Wb.Close False
EndIf
EndIf
End With
End Sub