vba

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA

VBA

resolvedResolved · Low Priority · Version 2003

De has attended:
Excel VBA Intro Intermediate course

VBA

Can I use a vlookup type function in VBA.

Lookup function in VBA

Hi

The simple answer is Yes.

You need to create a variable to store the lookup value. The variable type must equal the type of data being returned.

The code would be:

Dim MyLookupValue As [Type]

MyLookupValue = Application.WorksheetFunction.VLookup(LookUp_Value, Table_Array, Col_index_num, Range_Lookup)


Hope this helps

Carlos

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Random Numbers

Type =RAND()*200 to generate a number between 1 and 200.
Use the fill handle to drag down and populate as many cells as you'd like with random numbers.

View all Excel hints and tips


Server loaded in 0.08 secs.