Private Sub CommandButton19_Click()
' Import data from Lab Capacity Model'
Dim rng As Range
Dim objExcel As New Excel.Application
Dim AppExc As Excel.Application
Dim MyPath As String
MyPath = ThisWorkbook.Path
Set wbk = objExcel.Workbooks.Open(MyPath & "\Lab Capacity Model.xls")
Set wks = wbk.Sheets("Batches Record")
Set rng = wks.Range("A2:P5000")
Sheets("Batch Record LCM").Range("A2:Q5000").ClearContents
rng.Copy
Sheets("Batch Record LCM").Range("A2").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
wbk.Close False
Set wks = Nothing
Set wbk = Nothing
Set objExcel = Nothing
|