+ Reply to Thread
Results 1 to 5 of 5

Vlookup - finding multiple occurances

  1. #1
    Registered User
    Join Date
    07-14-2004
    Posts
    27

    Vlookup - finding multiple occurances

    Hi all!

    I have been trying to find all occurances of a value in a 14,000+ row table. I finally found this pice of code:

    Please Login or Register  to view this content.
    It works excellently well, but needs to be entered directly into a cell as an array (CTRL + SHIFT + ENTER). When I try to assign this value to a cell using VBA, the "Row" seems to be causing an issue since it uses the dbl quotes.

    Can anyone shed a little light on how I might be able to get VBA to accept this?

    Many thanks in advance!!!

  2. #2
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    One of several methods is to simply double up your quotes...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-14-2004
    Posts
    27

    a follow up

    Tom,

    Thanks so much. So simple,yet i could not figure it out.
    A follow up question, if I might:
    Now that they array is working perfectly during the first loop in the code, the cell references to A$1 and C$1 need to change as the code runs thru the 14,000+ lines. The Columns A and C remain contant, but the 'row number'(shown as 1) need to change based upon the variables "linestoinsert" and "rng" respectively. I think I am having more double, triple quote and ampersand issues...
    Please Login or Register  to view this content.
    BTW, the row needs to be referenced with the $ since the array is pasted to some additional rows before the 'row number' needs to be updated.

    Thanks again in advance for any help you could offer!

  4. #4
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    I'm not clear about what you need?

    ActiveCell.FormulaArray = "=IF(COUNTIF(INDEX(tbl2,0,1),A$" & linestoinsert &")>ROW...

    Is this your issue here?

  5. #5
    Registered User
    Join Date
    07-14-2004
    Posts
    27
    Tom,
    Thanks for the help. I just could not seems to count the quotes correctly, and then it was a spacing issue, but It fianlly got it!!! Thanks for the help!!!
    Last edited by zinzah; 08-25-2008 at 07:48 AM. Reason: It worked!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. vlookup in multiple worksheets
    By gto65l in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-25-2011, 01:04 PM
  2. Replies: 23
    Last Post: 07-14-2008, 10:29 PM
  3. Vlookup using two columns-needs to match the first two column
    By pduubb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2008, 01:21 PM
  4. Using VLOOKUP with Multiple Data Sheets
    By MJGC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2008, 08:14 PM
  5. Returning multiple values with VLOOKUP?
    By Krussadams in forum Excel General
    Replies: 1
    Last Post: 11-30-2006, 10:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1