+ Reply to Thread
Results 1 to 9 of 9

Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is found

  1. #1
    Registered User
    Join Date
    01-11-2021
    Location
    Ireland
    MS-Off Ver
    Excel for Office 365
    Posts
    9

    Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is found

    Hi,

    I have 2 ranges - Range 1(Sheet1 A1:A30) and Range 2(Sheet 2 B1:B600)

    I want to search each value from Range 1 and find it in Range 2. If the value is found in Range 2 I want to select that cell and put a border around it. Any suggestions would be greatly appreciated.

    Below is what I am trying but cant seem to get to it to work.

    Please Login or Register  to view this content.
    Thanks in advance!
    Last edited by Glenn Kennedy; 03-23-2021 at 09:15 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Sadly... in lockdown, but based in Ireland.
    MS-Off Ver
    µSoft Office 365. Learning Excel all over again!!
    Posts
    29,997

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then 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

    (Note: Since you are a relatively new user, on THIS occasion, I have doen it for you.)
    Glenn



  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,916

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Possibly...
    Please Login or Register  to view this content.
    Last edited by dangelor; 03-23-2021 at 09:33 AM.
    ____________________________________________________________
    If I've been helpful, let me know. If I haven't, let me know that too.

  4. #4
    Registered User
    Join Date
    01-11-2021
    Location
    Ireland
    MS-Off Ver
    Excel for Office 365
    Posts
    9

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Thanks Glenn!

  5. #5
    Registered User
    Join Date
    01-11-2021
    Location
    Ireland
    MS-Off Ver
    Excel for Office 365
    Posts
    9

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Thank you Dangelor but doesn't select the cell when found so is formatting which ever cell is selected on the worksheet prior to running the macro
    Last edited by Arkstone; 03-23-2021 at 12:48 PM.

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,916

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    The code is using the code name of the worksheets. Do the actual worksheets have the identical code names?

  7. #7
    Registered User
    Join Date
    01-11-2021
    Location
    Ireland
    MS-Off Ver
    Excel for Office 365
    Posts
    9

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Yes I'm using the correct sheet names in the code I just used Sheet1 and Sheet2 for the example

  8. #8
    Registered User
    Join Date
    01-11-2021
    Location
    Ireland
    MS-Off Ver
    Excel for Office 365
    Posts
    9

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Got it working using your suggestion above Dangelor. Just added "Application.Goto f "

    Code I used:

    Please Login or Register  to view this content.
    Thanks!

  9. #9
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,916

    Re: Search each value from Range 1 in Range 2 and select the cell in Range 2 if value is f

    Glad to hear it!


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Search Range for Value Contained in a Cell then Cut/Paste Row Where Value is Found
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-15-2017, 05:42 AM
  2. Replies: 10
    Last Post: 11-04-2015, 05:19 AM
  3. Replies: 4
    Last Post: 07-24-2015, 11:47 AM
  4. How to determine range to select once a reference cell is found?
    By ivoryg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2012, 10:29 AM
  5. Replies: 4
    Last Post: 05-12-2011, 02:25 PM
  6. Replies: 6
    Last Post: 10-14-2009, 03:01 AM
  7. Search a Range for a phrase and Format cell if found
    By Leaper@FakeEail.cooo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2005, 06:05 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