Hi All,
I have two files one is working. file (Working.xlsx) and LookupFile.xlsx attached images with some data.
I simply use the function called "Division"(shown below) to call the values from my LookupFile into Working.xlsx file
When I copy the "LookupFile.xls" Sheet within the working file its works but when I try to use the address using variable (extwbk) ... it doesn't work
please advise.
Once its working I will add this function as a custom Excel Add-in, so I and my colleagues can use it on any workbook.
i think I should be able to it myself the next step (Add this function as an Add-IN)
Thanks
I have two files one is working. file (Working.xlsx) and LookupFile.xlsx attached images with some data.
I simply use the function called "Division"(shown below) to call the values from my LookupFile into Working.xlsx file
When I copy the "LookupFile.xls" Sheet within the working file its works but when I try to use the address using variable (extwbk) ... it doesn't work
please advise.
Once its working I will add this function as a custom Excel Add-in, so I and my colleagues can use it on any workbook.
i think I should be able to it myself the next step (Add this function as an Add-IN)
Thanks
VBA Code:
Function Division(CC)
Dim extwbk As Workbook, twb As Workbook
Set extwbk = Workbooks.Open("K:\Finance\ManAccts\Month End Reports\Management Reporting Databases\99_Power_Bi_TB\LookupFile.xlsx")
Set x = extwbk.Worksheets("CostCentre").Range("A1:G1752")
Division = Application.WorksheetFunction.VLookup(CC, Range(x), 2, 0)
End Function