Can someone help me check my code. When I run the macro no error is popping but the data is not pasting to the specific worksheet.
Option Explicit
Sub Get_TM1PLReports_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your TM1 PL Report & Import Range", FileFilter:="Excel Files (*xls*), *xls*, Text Files (*.TXT), *.txt, All Files (*.*), *.*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("F:L").Delete
OpenBook.Sheets(1).Range("E56:AC150").Copy
ThisWorkbook.Worksheets("Sheet1").Range("B1").PasteSpecial xlPasteAllUsingSourceTheme
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Option Explicit
Sub Get_TM1PLReports_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your TM1 PL Report & Import Range", FileFilter:="Excel Files (*xls*), *xls*, Text Files (*.TXT), *.txt, All Files (*.*), *.*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("F:L").Delete
OpenBook.Sheets(1).Range("E56:AC150").Copy
ThisWorkbook.Worksheets("Sheet1").Range("B1").PasteSpecial xlPasteAllUsingSourceTheme
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub