+ Reply to Thread
Results 1 to 13 of 13

return missing values

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    return missing values

    Hi,

    I have two worksheets every with two column.
    In the first sheet in Column A are 4digit codes, in Column B should be filled in required information(missing indexes) .
    Sheet 2 is based on report for these 4 digit codes(column A) with existing indexes for these codes.
    The values for the indexes are between 1-9999 and they were not used sequentially.
    For example for code 1685 we can see in sheet2 that used indexes are 1,2,5,30,998 so in sheet 1 should be returned 3,4,6.

    Can you please suggest vba code that return unused indexes?

    Regards,
    Guerolito
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    You didn't mention how you want the result.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: return missing values

    Thank you Jindon,

    The results should be returned in sheet1 column "Index".

    Regards,
    Guerolito

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    Can you show me how exactly you want the result?

  5. #5
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21
    Result should looks like as in attached example file - sheet1 column index.

    Regards,
    Gguerolito

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    You know the result in message box is exactly the same as what is in Sheet1.

    So, no need to change Sheet1.

    Is that what you want?

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: return missing values

    I think we are almost there but probably I didn’t explain correctly situation so I’ll try again.
    In the example file I filled in Sheet1 “index” with the required indexes manually in order to explain requirements better, but normaly at the beginning I have only codes in Sheet1, index column is blank.
    I filter codes using Advanced filter in order to get unique codes. Then I run report for this unique codes to find already used indexes. The result of report is in Sheet2.
    And then I need VBA code to return in Sheet1 column “Index”
    indexes which have not been used yet.

    Regards,
    Guerolito

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    What do you mean by
    Quote Originally Posted by Guerolito
    indexes which have not been used yet.

  9. #9
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: return missing values

    indexes which have not been used yet = These are figures between 1-9999 which not exist in combination with respective Code in Sheet2

    Regards,
    Guerolito

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    You mean like this?
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: return missing values

    Thank you jindon
    It's very close to the solution.
    Just one remark.
    Is it possible not to change the returned indexes after every execution of code.
    I mean if there is no changes in workbook to return the same indexes after every execution.

    Regards,
    Guerolito

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: return missing values

    Just delete one line before End Sub which is
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: return missing values

    PERFECT!
    It seems that works as just like I want.
    Now I should understand how the code works.
    Again Thank you!
    Guerolito

+ 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