By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

Vlookup in Excel with VB code

P: 34
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
  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
Please assist me if possible
Apr 18 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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