prabha_friend
Board Regular
- Joined
- Jun 28, 2011
- Messages
- 95
Declaration:
Private wbAcctFees As Workbook
Public Function mac()
Set wbAcctFees = Workbooks.Open(frmPart1.txtAcctFees.Value)
End Function
Formula in a Cell:
=VLOOKUP(A2,INDIRECT("["&GetFileNamefromCode("wbAcctFees")&".xlsx]gen_rpt'!$A:$K"),11,)
Public Function GetFileNamefromCode(filevariable As String) As String
GetFileNamefromCode = Evaluate(filevariable).Name
End Function
Why its not working? and Whats the solution for this? Thanks in advance.
Private wbAcctFees As Workbook
Public Function mac()
Set wbAcctFees = Workbooks.Open(frmPart1.txtAcctFees.Value)
End Function
Formula in a Cell:
=VLOOKUP(A2,INDIRECT("["&GetFileNamefromCode("wbAcctFees")&".xlsx]gen_rpt'!$A:$K"),11,)
Public Function GetFileNamefromCode(filevariable As String) As String
GetFileNamefromCode = Evaluate(filevariable).Name
End Function
Why its not working? and Whats the solution for this? Thanks in advance.