473,668 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vlookup in visual basic

could someone tell me the correct syntax for using vlookup
in visual basic
Nov 20 '05 #1
4 11893

"Rebecca" <an*******@disc ussions.microso ft.com> wrote in message
news:79******** *************** *****@phx.gbl.. .
could someone tell me the correct syntax for using vlookup
in visual basic


VLOOKUP is an Excel worksheet function. I've never heard of it existing in
VB. Could you provide more details on what you're trying to do?
Nov 20 '05 #2
It says in the help that vlookup can be used in visual
basic, what I am actually doing is in the spreadsheet
looking to the top of the column reading C2 then going to
another spreadsheet and finding that value and giving the
value in the col next to it, as vlookup does in excel.
Then if it is the same a macro starts which deletes the
original row and moves the rest of the table along. I
tried to do it in excel but once the macro has run the
cell reference for C2 is lost, so I thought I could try it
in a macro. Any ideas?
-----Original Message-----

"Rebecca" <an*******@disc ussions.microso ft.com> wrote in messagenews:79******* *************** ******@phx.gbl. ..
could someone tell me the correct syntax for using vlookup in visual basic
VLOOKUP is an Excel worksheet function. I've never heard

of it existing inVB. Could you provide more details on what you're trying to do?

.

Nov 20 '05 #3

<an*******@disc ussions.microso ft.com> wrote in message
news:79******** *************** *****@phx.gbl.. .
It says in the help that vlookup can be used in visual
basic,


"The help"? The help for Excel? If that is what you mean, then it's
referring to the fact that you can access this function (and any worksheet
function) from VBA. If you are indeed writing in VBA (i.e., creating a macro
from within Excel itself) then you'd be much better served by asking in the
proper group. I recommend microsoft.publi c.excel.program ming.
Nov 20 '05 #4
Rebecca,

You can use just about any Excel function in VB. You must first include the
Microsoft Excel 9.0 Object Library reference in your application.

Assuming you already created an Excel object and have a reference to a
particular sheet, the syntax for VLookup is

sFound = Application.Wor ksheetfunction. VLookup(sWhatTo LookFor,
WorksheetIdenti fication.Worksh eets("sheetName " or #).Range(Range to look in)

Any of the Worksheet functions are available through the Worksheetfuncti on.

the WorksheetIdenti fication is the variable you assigned to the worksheet
you are working on.

Hope this helps

Gary

"Rebecca" wrote:
could someone tell me the correct syntax for using vlookup
in visual basic

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
38812
by: chudson007 | last post by:
I've got a data set on which I'm trying to perform the same as excel's vlookup formula using SQL, but do not know how. Can anyone help? If you picture me having two tables Table_A and Table_B and they look like this; Table_A Name Sport John Football John Rugby Steve Cycling
3
21232
by: Fred | last post by:
I am trying to come up with a way to lookup values in Access as easily as I can in Excel. My application is looking up scores. An example lookup table below explains what I'm after: TABLE1 Measure (pct) Number score Letter grade Disposition 1% 40 A Pass 6% 36 B
3
2461
by: Fred | last post by:
I have an application that involves calculating a score based on a number of defects. Simplified example of the scoring: No_Defects Score 1-3 A 4-15 B 16-25 C over 25 X In Excel this is easy using a vlookup with its bin system
2
494
by: Rebecca | last post by:
could someone tell me the correct syntax for using vlookup in visual basic
1
2593
by: Crash91 | last post by:
I am using this formula in my sheet =VLOOKUP(A10,table,2) A10 is a cell that has the function :Left(sheet1!"c10"), it contains the correct value needed for the lookup but its isnt working! Can anyone help out? Thanks in Advance
0
4005
NeoPa
by: NeoPa | last post by:
VlookUp or Vertical LookUp is a function that enables Excel to ‘Find’ related items from within a range stored elsewhere. Elsewhere can mean another excel workbook on another PC, but can also mean a range in the current worksheet. In any Range reference in Excel, a ’$’ preceeding an element of the address, simply tells Excel not to be clever when copying or dragging the formula to other cells. Notice the formulas displayed in column B below:...
5
17611
by: catlover30 | last post by:
HI, I need help with excel VLOOKUP! I am at a new job and really trying to solve this without asking anyone at work, since they seem th expect me to know this. What I am trying to acheive is the same thing as a FULL OUTER JOIN if you are familiar with sql. I tried to do this is in access, but access does not support full joins. Anyhow: I have two email lists, one woth 2500 entries, one with 2600. They are located in same worksheet, one in...
4
19975
by: ritheshtitu1982 | last post by:
Hi, I would like to perform Vlookup in access. Eg. I have two Tables Code table Code --- No { ------- 0 } ------- 1
1
6779
by: scubasteve | last post by:
Looking up values from an Access table is simple. Simulating the 'Range Lookup' functionality from Excel's VLookup formula is a bit trickier. For those that aren't familiar with this, it allows you to look up the next smallest value to what you provided, and return any corresponding field from the table. Very useful for looking up things like currency exchange rates, tax rates, etc., where there might not be an entry for every day/income...
9
3628
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in access. For a user mismatch, it should give NA Thx.
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8371
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2782
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.