+ Reply to Thread
Results 1 to 5 of 5

Looping Question

  1. #1
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Looping Question

    Have this code:

    Please Login or Register  to view this content.
    This gets the value from column B sheet2 to matching name in column A Sheet 1 and puts it in column B sheet 1. But the first and third values in column B sheet1 are not found for some reason. It can go all the way down and everything else is found. This is how it works:

    Col A Sheet 1

    Item 1
    Item 2
    Item 3
    Item 4
    Item 5
    Item 6
    Item 7
    Item 8
    Item 9
    Item 10

    Col A & B Sheet 2

    Item 1 1.99
    Item 2 2.99
    Item 3 3.99
    Item 4 4.99
    Item 5 5.99
    Item 6 6.99
    Item 7 7.99
    Item 8 8.99
    Item 9 9.99
    Item 10 10.99

    After running code looks like this Columns A,B,C Sheet 1

    Item 1 NotFound
    Item 2 2.99 Found
    Item 3 NotFound
    Item 4 4.99 Found
    Item 5 5.99 Found
    Item 6 6.99 Found
    Item 7 7.99 Found
    Item 8 8.99 Found
    Item 9 9.99 Found
    Item 10 10.99 Found
    Last edited by light; 02-21-2019 at 02:07 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Need code adjustment

    Thanks for the changes
    Last edited by FDibbins; 02-21-2019 at 03:38 AM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Need code adjustment

    oops - deleted as instructed!
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Need code adjustment

    Your code is not the problem
    - the contents of your cells do not match
    - a trailing space perhaps

    Test with this formula (where A1 is each of the 4 cells in turn)
    =LEN(A1)

    The length of "Item 1" and "Item 3" is 6
    2 of the 4 cells will return a different value

  5. #5
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Need code adjustment

    Kev

    Thanks. Seems to work today. You may have been right about not having an exact match.

+ 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. [SOLVED] Code To Paste needs adjustment
    By STU22 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2014, 09:47 AM
  2. [SOLVED] Slight code adjustment please
    By dannac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2012, 04:36 PM
  3. Word Count VBA Code Adjustment
    By skate1991 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2012, 06:28 AM
  4. [SOLVED] my VBA code needs an adjustment
    By frankie k in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-06-2012, 01:16 AM
  5. Code adjustment
    By tofimoon4 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 12:21 PM
  6. Code Adjustment split to csv
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-14-2011, 11:07 AM
  7. code adjustment - copy picture 1 or 2 IF...
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2009, 08:34 AM

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