pulling information from a closed workbook

E

edluver

i know that the following UDF will retrieve specified information from a
closed notebook:

Function GetValuesFromAClosedWorkbook(fPath As String, _
fName As String, sName, cellRange As Object)
With ActiveSheet.cellRange
.FormulaArray = "='" & fPath & "\[" & fName & "]" _
& sName & "'!" & cellRange
.Value = .Value
End With
End Function


Sub test1()
GetValuesFromAClosedWorkbook "E:\Documents\Work\Fraud Detection",
"DFDDEPFRDH.xls", _
"Untitled", .Select
End Sub

i have 2 questions. 1) how can i alter this so it will copy the entire
worksheet over?

2) How can i alter this to copy a second set of sheets to Sheet2 instead of
Sheet1?

thanks for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top