+ Reply to Thread
Results 1 to 4 of 4

VBA Code to search through a different Excel file

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    VBA Code to search through a different Excel file

    Hello All,

    I am using a Macro to transfer a specific range of data based on some criteria from one sheet to another.

    Unfortunately I need to take the data sheet away from the file and keep it as a separate file due to that being shared for updates.

    I am running the following code:
    Please Login or Register  to view this content.
    How can I change the code so that Sheets Database will be referred to as of a different file, e.g. G:\Documents\Database.xlsx sheet would be still called Database in there?

    I don't understand how to manipulate that above shown code to go into a different file to take it and yet come back to the output sheet as it is above.

    Any suggestions much appreciated.

    Thank you in advance,

    Simon
    ...and this is when I walk in, dressed fully in white...

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA Code to search through a different Excel file

    Hi Simon

    Something like this...untested....Upload a sample of each fro testing if need be...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: VBA Code to search through a different Excel file

    Hi,

    It has done the trick.

    I have altered it to suit.

    Thank you.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA Code to search through a different Excel file

    Great stuff. thanks for 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. Vba code to search file and attach based on column
    By Jayakumar1313 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2017, 08:22 AM
  2. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  3. Macro to search a .txt file for matching strings existing in an excel file.
    By Firstlady in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2015, 03:27 PM
  4. Search Folder + Search Excel File and Sum
    By Vanda_a in forum Excel General
    Replies: 1
    Last Post: 03-06-2015, 12:00 PM
  5. VBA Excel function to search computer for given file name and return file path
    By knuckles2290 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2013, 02:35 AM
  6. VBA code to handle and search within txt file
    By jdcaro55 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 12-21-2011, 04:59 PM
  7. Code to search PDF file
    By sirak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2007, 12:27 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