A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

VLOOKUP in VBA



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 21st, 2010, 12:58 PM posted to microsoft.public.excel.worksheet.functions
G.P.N.L. c.v.a.
external usenet poster
 
Posts: 13
Default VLOOKUP in VBA

I am a beginner in VBA; nevertheless, I already have several working UDF's
in Excel 2003, though.

Why does TGI(A213) gives me "#VALUE!"
- while A213 contains "30/11/2013",
- the formula - in the right module - is :
Option Explicit

Function TGI(ABC As Date) As Single

TGI = Application.WorksheetFunction.VLookup(ABC, _
Range(Workbooks("INDEX.XLS").Worksheets("INDEX").R ange("DBINDEX")),
_
2, _
True)

End Function
- the range DBINDEX in the sheet INDEX in the workbook INDEX.XLS is A2:G470,
and
- in that range cell A373 contains "30/11/2013" ?

Can somebody help me ?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.