Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
Sub Host03GetValue() p = "c:\Test\" 'p is the path to the document' f = "HOST03.xls" 'f is the filename of the excel sheet' s = "tabvInfo" 's is the sheet name' a = "A16" 'a is the reference cell' Application.ScreenUpdating = False For r = 2 To 42 For c = 1 To 1 a = Cells(r, c).Address Cells(r + 8, c + 1) = GetValue(p, f, s, a) Next c Next r Application.ScreenUpdating = True End Sub
Public Function GetValue(path, file, sheet, ref) ' Retrieves a value from a closed workbook Dim arg As String ' Make sure the file exists If Right(path, 1) <> "\" Then path = path & "\" If Dir(path & file) = "" Then GetValue = "File Not Found" Exit Function End If ' Create the argument arg = "'" & path & "[" & file & "]" & sheet & "'!" & _ Range(ref).Range("A1").Address(, , xlR1C1) ' Execute an XLM macro GetValue = ExecuteExcel4Macro(arg) End Function