+ Reply to Thread
Results 1 to 14 of 14

VB Script search within a column in one Wb and find in another WB and Highlight yellow

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Hi
    I am looking for a way to search all text within each row within one column and find the exact match in another workbook and highlight that cell yellow.

    is there an easy script that can run and complete this quickly. it would save me hours of work.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Is something wrong with the way I entered it. I only want to search text in A1:A500 then find each cell within that range in A1:A5000 in the other workbook and highlight it Yellow
    Please Login or Register  to view this content.
    Last edited by DixieDiver; 10-22-2014 at 03:28 PM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Per Forum Rule No. 3. You must use code tags when posting.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 10-22-2014 at 03:30 PM.

  5. #5
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Sorry i fixed it.

  6. #6
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    I get an error still. "out of range"
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Hi Dixie,

    If your search column for the 2nd workbook is also similar as "A" then try this code.

    If it's a fixed column, however a different one than you can amend "1" to whatever you'd like under "ImportWB"

    Paste in a new module

    Please Login or Register  to view this content.
    If you want to search the entire sheet with all the columns then you can use John's Code.

    Just try removing

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Jayesh25

    your code runs without error, but I still don't see the code highlighting the cells yellow when it finds a match. Just to clarify, in column A1:A500 i have tag names in the missing PI tags workbook. I want to search for those tags in the DB workbook in Column A1:A50000 and highlight the cells yellow when found.

    Thanks for you guy's quick response. Very much appreciated

  9. #9
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    DixieDiver,

    I had set the workbook names the other way around. Retry the below code? I've changed the route from Missing Tags > DB now

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Awesome that worked great
    Thank you thank you thank you

  11. #11
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Most welcome

  12. #12
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Just thought of an enhancement for this code that would be helpful. using the code above how would I also highlight the tags that could not be found Red in the original document "Missing PI Tags 20141021b.xlsx"

  13. #13
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Hi Dixie.

    I've made some modifications. Try this?
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VB Script search within a column in one Wb and find in another WB and Highlight yellow

    Worked like champ, just had to change the second if found it =1 to 0

    Thanks again

+ 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] Find number and highlight in yellow
    By Jerry HKA in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-10-2014, 04:17 AM
  2. [SOLVED] find last empty cell and highlight yellow
    By James__S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2014, 03:46 PM
  3. [SOLVED] Highlight Yellow Active Row, PROBLEM: row selected before closing stays yellow
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2013, 07:01 PM
  4. Highlight blank cells in yellow.
    By n_lindsey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2013, 02:17 AM
  5. Macro To find match Value from other clomn and highlight in yellow
    By tariqnaz2005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2012, 09:42 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