+ Reply to Thread
Results 1 to 5 of 5

Want to do a search on one column then return a value from a column two over

  1. #1
    Registered User
    Join Date
    06-11-2010
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    55

    Question Want to do a search on one column then return a value from a column two over

    We have a lookup table on my Control WS that looks like attached. I want to write code to do a find on my Object lookup table so that when I pass an ObjSubIn = 8124 then my function will pass back the value of "Q" in column N. How do I do this. This is the code I have coded so far but it is not exactly what I want. Does anyone have any recommendations to cange this code so I get what I want. The client has many different object accounts so I am using this lookup table to identify which column to update in a worksheet instead of hardcoding all my object accounts and columns. Here is the code I have so far. The FIND command works good but I need to return the row and column of where my 8124 was found so I can go two columns over and return the appropriate "Object Column" value.

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by cmwilbur; 08-13-2010 at 03:41 PM.
    cmwilbur

  2. #2
    Registered User
    Join Date
    06-11-2010
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Want to do a search on one column then return a value from a column two over

    I found a possible solution on the web which seems to do what I want it to do. I am now testing the code.

    Please Login or Register  to view this content.
    Last edited by cmwilbur; 08-13-2010 at 03:39 PM.

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Want to do a search on one column then return a value from a column two over

    Why not use Vlookup?

    http://office.microsoft.com/en-us/ex...005209335.aspx

  4. #4
    Registered User
    Join Date
    06-11-2010
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Want to do a search on one column then return a value from a column two over

    Need to do search within VBA. Looked on the web to code using VLookup logic within VBA but I could not figure the VLookup logic out so I coded it this way. If you have any other ideas I am very willing to hear your suggestions.
    Last edited by cmwilbur; 08-13-2010 at 03:48 PM.

  5. #5
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Want to do a search on one column then return a value from a column two over

    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