Hello again guys,

Here's a new doubt..hehe. I'm finishing a project that I started yesterday. The first part is all done, the part that I need help is the one in the subject, i.e., I need to browse a file, open it, copy selected data from Sheet2 and paste it to the 2nd sheet of my active workbook, copy selected data from sheet3 and paste it to the 3rd sheet of my active workbook and finally close the book I opened without saving changes.

This kind of code is too hard to me to understand at this point. I did a lot of research and come up to this code which is some way similiar to what I require:

Sub Sample()
    Dim wb1 As Workbook, wb2 As Workbook
    Dim Ret1
 
    Set wb1 = ActiveWorkbook
 
    '~~> Get the File
    Ret1 = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*", _
    , "Please select first file")
    If Ret1 = False Then Exit Sub
 
   
    Set wb2 = Workbooks.Open(Ret1)
    wb2.Sheets(1).Copy Before:=wb1.Sheets(1)
    ActiveSheet.Name = "Copied Sheet"
    wb2.Close SaveChanges:=False


    Set wb2 = Nothing
    Set wb1 = Nothing

End Sub

This code browses a File, copy the entire sheet1 from the book I opened to a newly created Sheet1 of my Active workbook, name it "Copied Sheet" and closes the book wb2 without saving changes.
I think I can use some of the code, but then adapt it to my case.

Therefore what I need is something more speficic in this part, i think:


    wb2.Sheets(1).Copy Before:=wb1.Sheets(1)
    ActiveSheet.Name = "Copied Sheet"
    wb2.Close SaveChanges:=False

Specifications:

Sheet2
What I need to copy from Sheet2 of wb2 is
Range("A5:H" & ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row)
And paste it to Sheet 2 of my Active workbook at
Range("B8:I" & ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row)

Sheet3
What I need to copy from Sheet3 of wb2 is
Range("A5:I" & ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row)
And paste it to Sheet 3 of my Active Workbook at
Range("A8:I" & ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row)

Please let me know if I was not clear enough or if you have some doubts about it.
Looking forward for a feedback.
Many thanks.


Kind Regards,
FCarv