+ Reply to Thread
Results 1 to 5 of 5

using vlookup to find range

  1. #1
    Registered User
    Join Date
    11-20-2009
    Location
    south wales
    MS-Off Ver
    Excel 2007
    Posts
    14

    using vlookup to find range

    i have an equation that involves the program looking for a specific cell on the worksheet, the cell i want however is dependnant on the given value for my vlookup.

    i use an input box to specify throt, and i tried the code below but cant get it to work, can you see anything wrong with it?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016
    Posts
    3,393

    Re: using vlookup to find range

    Hi,

    I think this might be what you're after

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    11-20-2009
    Location
    south wales
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: using vlookup to find range

    hi sweep, thanks for the help. ive applied the code to a simple loop just to test it but im getting a Type Mismatch error. the code is as follows:

    Please Login or Register  to view this content.
    The help file states the variable isnt of correct type, though i cant see where ive gone wrong

  4. #4
    Registered User
    Join Date
    11-20-2009
    Location
    south wales
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: using vlookup to find range

    right i think i may be getting somewhere although im not quite there. been trawling through the excel help files and have found that i can use "Cells" property within a range. this avoids the problem of using vlookup directly within the range object.

    the code ive created is as follows:
    Please Login or Register  to view this content.
    with the vlookup function in place of x

    Please Login or Register  to view this content.
    when trying to run it however the following error " application-defined or object-defined error"

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016
    Posts
    3,393

    Re: using vlookup to find range

    Shouldn't it be

    Please Login or Register  to view this content.
    ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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