Import data from get file to master file sheet (Macro sheet)

  • Application.ScreenUpdating = False

    Dim FileToOpen As Variant
    Dim OpenBook As Workbook, shAllBranch As Worksheet
    Dim r As Long

    r = Range("A6").End(xlDown).Row + 1

    FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", Filefilter:="Excel Files (*.xls*),*xls*")
    ' FileToOpen = Application.GetOpenFilename(Filefilter:="Excel Files (*.xlsx), *.xlsx", Title:="Select Workbook to Import", MultiSelect:=True)

    If FileToOpen <> False Then
    Set ActiveSheet = Application.Workbooks.Open(FileToOpen)
    ActiveWorkbook.Worksheets("Sheet1").Range("A" & r).PasteSpecial xlPasteValues
    End If
    Application.ScreenUpdating = True

    End Sub

    Afterwards need to short based on coulmn A in the master sheet

  • royUK

    Closed the thread.