473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Vlookup in Excel with VB code

34
Hi,
I need to write VB code in Excel to check in each row of a column for the word "reference". If the word is there, I need to change the code in the same row, but another column, to "Left(G3,1)". (but not G3, it must be column G, but the row must be the same as the row that "reference" is in).

This is my present code, (but obviously wrong):
Expand|Select|Wrap|Line Numbers
  1.  Dim a
  2. For Each a In Range("F3:F4000")
  3. If Mid$(a.Formula, 1, 1) <> "=" Then Mid$(a.Formula, 1, 15) = "Left(G18,1)"
  4. Next
  5.  
  6.  
  7.      Dim Counter
  8.      Counter = 0
  9.      i = 3
  10.      While i = 0
  11.      If Sheets("Main").Cells(i, 22) = "Reference" Then toets = False
  12.      Counter = i + 1
  13.      Wend
  14.  
Please assist me if possible
Tnx!
Apr 18 '08 #1
0 927

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
3
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...
3
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 ...
2
by: Rebecca | last post by:
could someone tell me the correct syntax for using vlookup in visual basic
0
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...
5
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...
0
by: mikelever | last post by:
Hi, i have the following sendmail macro. However I need the "To" section to be the result of a lookup in a worksheet. The specific function that i need it to be is: =VLOOKUP(A837,'Tenacity...
1
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...
9
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...
11
by: memiles | last post by:
Table 1 Part number, Data, Data1, Data2..... (Part Numer in this table is duplicated multiple times) Table 2 Part Number, Data 3...... (Part Number in this table is not duplicated) I would...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.