XLA routines: EE_ImportFromFile
Import a file's contents using EE_ImportFromFile
Sub EE_ImportFromFile(wbkFullPath As String, strSheet As String, rngTarget As range) Dim wbkSrc As Workbook Dim wksSrc As Worksheet 'http://excelexperts.com/xla-routines-eeImportFromFile for updates on this function If EE_FileExists(wbkFullPath) = False Then Exit Sub Set wbkSrc = Workbooks.Open(wbkFullPath) Set wksSrc = wbkSrc.Worksheets(strSheet) wksSrc.UsedRange.Copy rngTarget.PasteSpecial xlPasteValues rngTarget.PasteSpecial xlPasteFormats Application.CutCopyMode = False wbkSrc.Close False Set wksSrc = Nothing Set wbkSrc = Nothing End Sub
»
- Nick's blog
- Login or register to post comments
- 1860 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago