+ Reply to Thread
Results 1 to 6 of 6

Compare two string array and list what is not present in array 2

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Compare two string array and list what is not present in array 2

    Hi all
    Checking if cell has checkbox. I have an array of cell addresses from a range (MyArr) and I want to highlight what addresses do not have a corresponding checkbox

    I can list the addresses in the array that have a checkbox

    Please Login or Register  to view this content.
    but this doesn't give me the addresses that have no checkbox
    Please Login or Register  to view this content.
    any ideas??
    Last edited by nigelog; 02-27-2019 at 05:51 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Compare two string array and list what is not present in array 2

    posted in wrong section - apologies I didn't notice what was open. Can it be moved please to VBA section

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,811

    Re: Compare two string array and list what is not present in array 2

    Thread moved. In future, it’s actually better to use the report post button as then all mods and admins are alerted.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Volunteer organiser & photographer with the Sutton Hoo Ship's Company: https://saxonship.org/
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Compare two string array and list what is not present in array 2

    In the first case you are looping around each checkbox. In the second case you are doing the same but don't you need to also loop around each cell in your range of interest?

    The attached code looks for checkboxes in "testRng" and outputs in "outputArray" for each cell in "testRng" either "No associated checkbox" or the cell address if there is an associated checkbox.

    I'm afraid it has drifted quite a long way from your code, so I hope you can still get at least a little something of use from it.

    Please Login or Register  to view this content.
    Attached is the associated workbook
    Attached Files Attached Files

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Compare two string array and list what is not present in array 2

    Thanks Geoff
    I have been able to use to give me the output required of only addresses with no checkbox. Many thanks
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Compare two string array and list what is not present in array 2

    Glad it was some use. Thanks for the rep

+ 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] Create array of items which are in List A but not present in List B
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2018, 01:28 AM
  2. Compare Range list with String Array list (both same # of values)
    By mgmAB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2016, 06:58 AM
  3. How to check if a string is present inside a multidimensional array
    By cgkmal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2014, 01:31 AM
  4. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  5. Replies: 4
    Last Post: 12-23-2013, 08:43 AM
  6. search for a part of string within an array of strings from another array list
    By jdonohue in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2011, 01:32 PM
  7. Compare String array contents
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-27-2010, 06:00 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