+ Reply to Thread
Results 1 to 8 of 8

VBA to search for value in all sheets of other workbook

  1. #1
    Registered User
    Join Date
    10-19-2020
    Location
    Tokyo, Japan
    MS-Off Ver
    365
    Posts
    98

    VBA to search for value in all sheets of other workbook

    Hello everyone

    I have two files.
    1. Workfile (where the macro will be stored)
    2. Valuefile

    I want to search for the value in C16 of the workfile in column D in all sheets of the valuefile.
    If found copy the value of column O of the found row to the workfile (column G).

    How can I achieve this?
    Thanks in advance for your help.
    Attached Files Attached Files
    Last edited by esukei; 12-12-2022 at 09:16 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,861

    Re: VBA to search for value in all sheets of other workbook

    Try:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

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

    Re: VBA to search for value in all sheets of other workbook

    For the files uploaded.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-19-2020
    Location
    Tokyo, Japan
    MS-Off Ver
    365
    Posts
    98

    Re: VBA to search for value in all sheets of other workbook

    Thank you for your code.
    Unfortunately the sheets are not called "Sheet 1" or "Sheet 2" as in my example. They can have random names and can be more than 3 sheets per workbook.

  5. #5
    Registered User
    Join Date
    10-19-2020
    Location
    Tokyo, Japan
    MS-Off Ver
    365
    Posts
    98

    Re: VBA to search for value in all sheets of other workbook

    Quote Originally Posted by Kaper View Post
    Try:
    Please Login or Register  to view this content.
    Thank you. This works if the Valuefile is already open.
    How can I add a network path to a folder and open the Excel file in it automatically?

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

    Re: VBA to search for value in all sheets of other workbook

    Change to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-19-2020
    Location
    Tokyo, Japan
    MS-Off Ver
    365
    Posts
    98

    Re: VBA to search for value in all sheets of other workbook

    Quote Originally Posted by jindon View Post
    Change to
    Please Login or Register  to view this content.
    Thank you.
    Unfortunately the line below gets always an error:

    Please Login or Register  to view this content.
    Attachment 809098

  8. #8
    Registered User
    Join Date
    10-19-2020
    Location
    Tokyo, Japan
    MS-Off Ver
    365
    Posts
    98

    Re: VBA to search for value in all sheets of other workbook

    Ok I was able to get it running.
    Thank you all for your help.


    Please Login or Register  to view this content.

+ 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. Search in different sheets in same workbook
    By vpr135 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2020, 03:39 AM
  2. Search workbook with many sheets for a value then pull that value into a cell in a new she
    By funnybunny303 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2019, 03:53 PM
  3. Search all sheets for a value then copy value to the workbook?
    By zoenightshade in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2015, 11:23 AM
  4. Search and Some from different sheets in Same workbook
    By irfanhashim18 in forum Excel General
    Replies: 2
    Last Post: 03-24-2015, 11:01 AM
  5. [SOLVED] Search for a part number in all (max 20) sheets of a workbook
    By Oujous in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2012, 04:03 AM
  6. search a workbook, regardless of No of sheets and then run a comparision b
    By Aelemar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2007, 06:49 PM
  7. Search for Value across multiple sheets of another workbook
    By kys2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2007, 07:18 PM

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