+ Reply to Thread
Results 1 to 3 of 3

Insert Vlookup Depending On Certain Conditions

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Smile Insert Vlookup Depending On Certain Conditions

    I am trying to retrieve data from another file using the VLOOKUP function however this is only to happen depending on if any of the 3 items of data appear in column 8(H)

    OLY
    OLY - QUO
    OLY - PRO


    I have the following and know this is not correct


    Sub BlockAllocationsVlookupAll()

    Dim x As Long For x = 1 To 65536

    If InStr(1, Sheet1.Range("$H$" & x), "OLY") > 0 Then Sheet1.Range("$I$" & x) = Sheet1.Range("$I$" & x) & "sometext" End If Next

    End Sub


    I know the above doesn't do exactly what I need can anyone help as to what needs to be edited to include the Vlookup below


    =VLOOKUP(A21,'[001 - Allocations - Blocks.xls]CurrentDayAll'!$1:$65536,9,FALSE)


    The other issue is that the cell the VLOOKUP points to first will also change due to the varying length of the report

    Thank you for any help given

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Vlookup Depending On Certain Conditions

    Hi, TkdKidSnake,

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...onditions.html

    ___

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    05-06-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Insert Vlookup Depending On Certain Conditions

    Quote Originally Posted by HaHoBe View Post
    Hi, TkdKidSnake,

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...onditions.html

    ___

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    My apologies

    Also this has now been solved see below

    [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE]

+ 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. Insert formula depending on cells depending of variables
    By elmexicano87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 01:22 PM
  2. Summing values in a row depending on certain conditions being met.
    By GavJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-11-2013, 01:30 AM
  3. Tracking due date depending on conditions
    By Abhijit2011 in forum Excel General
    Replies: 6
    Last Post: 11-29-2011, 08:00 AM
  4. Need to change the range of SUM depending on some conditions
    By elriba in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2010, 06:05 PM
  5. Copy row depending on two conditions
    By cj100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2010, 06:28 PM

Tags for this Thread

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