WindsorKnot
Board Regular
- Joined
- Jan 4, 2009
- Messages
- 160
Hi,
I'm having trouble with the one part of my code
I'm trying to basically do a Vlookup in a VBA Function, but I can't seem to get it right as I get the #VALUE! Error. Any guidance would be appreciated.
Thanks!
I'm having trouble with the one part of my code
I'm trying to basically do a Vlookup in a VBA Function, but I can't seem to get it right as I get the #VALUE! Error. Any guidance would be appreciated.
Thanks!
Code:
Public Function NetCostEE(FAverageCost As Variant)
' Define the data Parameters
Dim R1 As Range
Set R1 = Sheets("Mig").Range("F20:G50")
NetCostEE = WorksheetFunction. _
VLookup(FAverageCost, Range("R1"), 2, False)
End Function