Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Guys,
I happen to come across this codes from www.exceltip.com. I am wondering whether is there a way to create a user form that can prompt user to enter or select the name of the file of th e closed workbook and worksheet that we they want to get the data from. The following is the code that will get value from a closed workbook. But the problem is that the file name of the closed workbook and worksheet is hard coded. What i need is for the user to enter those information. I hope someone can hel me out in this. Sub test() GetValuesFromAClosedWorkbook "C:", "Book1.xls", _ "Sheet1", "A1:K30" End Sub Sub GetValuesFromAClosedWorkbook(fPath As String, _ fName As String, sName, cellRange As String) With ActiveSheet.Range(cellRange) .FormulaArray = "='" & fPath & "\[" & fName & "]" _ & sName & "'!" & cellRange .Value = .Value End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enter a User Name When Changes are Made | Excel Worksheet Functions | |||
enter user in cell | Excel Worksheet Functions | |||
User must enter something in a range of cells | Excel Discussion (Misc queries) | |||
Macro to have user enter new worksheet name | Excel Programming | |||
Do combobox allow user to enter text? | Excel Programming |