+ Reply to Thread
Results 1 to 9 of 9

Excel Macro search and copy function in subfolders

  1. #1
    Registered User
    Join Date
    10-17-2018
    Location
    Frankfurt, Germany
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Excel Macro search and copy function in subfolders

    Hello everybody,
    i've again some problems with my VBA-Code and hopefully some of you can help me.
    The macro search in a directory after excel files with certain names and then copy the data to another workbook, this works perfect thanks to the hepf of this forum!
    But know, i want that the macro not only copy the data from this folder but als from the subfolders and i struggle to realize that.
    I'm really a newbie in VBA, so if anyone could help me with this, that would be great!

    Here's my code:
    Please Login or Register  to view this content.
    Greetings
    Last edited by alansidman; 11-06-2018 at 01:32 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Excel Macro search and copy function in subfolders

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    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, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,256

    Re: Excel Macro search and copy function in subfolders

    Maybe like this
    Please Login or Register  to view this content.
    "ThankyouFor Attention * And Your Help!!"

  4. #4
    Registered User
    Join Date
    10-17-2018
    Location
    Frankfurt, Germany
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Excel Macro search and copy function in subfolders

    I've tried to implement it but i just get som error notification. Could you tell me what is wrong?

    Here's my modified code:
    Please Login or Register  to view this content.
    Last edited by gedingen_35; 11-07-2018 at 06:52 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,256

    Re: Excel Macro search and copy function in subfolders

    TRY THIS
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-17-2018
    Location
    Frankfurt, Germany
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Excel Macro search and copy function in subfolders

    I've tried it but become an error post(438) in this line:

    Please Login or Register  to view this content.
    Do you have an idea what could be the problem?

  7. #7
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,256
    First yo must select main folder
    Folder a contain sub folder 1 and folder 2
    Your path must select
    "c:\blallalal\a\"
    Its work for me
    Last edited by jeffreybrown; 11-07-2018 at 07:14 PM. Reason: Removed full quotes!

  8. #8
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,256
    Please Login or Register  to view this content.
    Change to
    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 11-07-2018 at 07:14 PM. Reason: Removed full quotes!

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Excel Macro search and copy function in subfolders

    daboho,

    Please don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.
    HTH
    Regards, Jeff

+ 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. macro search in folder and subfolders
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 06-13-2018, 04:15 PM
  2. Replies: 4
    Last Post: 10-21-2016, 05:33 PM
  3. Replies: 1
    Last Post: 10-19-2016, 04:44 PM
  4. Needs macro to copy excel files from folders, subfolders to new folder
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2014, 08:53 AM
  5. Macro to search folder including subfolders for file and open
    By kiraexiled in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2012, 02:45 PM
  6. [SOLVED] Search subfolders in excel 2010
    By greasybob in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-08-2012, 07:03 PM
  7. Replies: 2
    Last Post: 03-26-2012, 07:12 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