+ Reply to Thread
Results 1 to 17 of 17

prefix folder name to files with excel vba

  1. #1
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    prefix folder name to files with excel vba

    Hi

    I have many folders each folder has separate name inside that folders there are some pdf files and each file should get prefix name of the particular folder.

    Example : FolderName --->Test -------> Test folder -----> i have pdf files ------------>files names will be text1.pdf, text2.pdf ,text3.pdf

    output :Testtext1.pdf ,Testtext2.pdf,Testtext3.pdf


    In Single Example folder i have 150 folders all folders have uniques names and files.

    all i want is each folder name should apply to files inside that folders (Required loop through each folder prefix folder name to files and exit and goto do the same)


    Thanks in advance
    Last edited by druva; 07-25-2019 at 11:25 AM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    Hello
    Can you spot on the problem by giving more details ..? You can use snapshots to show the final desired output
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

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

    Re: prefix folder name to files with excel vba

    Something like this...Put the macro file in the Example folder
    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!!!

  4. #4
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    Thank for you code ,when i run this code example folder its says path not found error. but in example folder i have 150 folders in that folders i have subfolders

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

    Re: prefix folder name to files with excel vba

    Your hierarchy...As I understand it...
    Main Folder...store excel file containg code in this folder...
    Sub Folder
    Folder
    PDF file...Which must be renamed to SubFolder & pdf File.name

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    Try this code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    Thank you ....it worked like charm

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    You're welcome. Glad I can offer some help

  9. #9
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    I required one more help ... how to separate searchable pdf and non searchable pdf from this folders

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    I didn't get what you mean ..?
    Do you mean you need to move those files to another location ...?

  11. #11
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    I Have pdf files in this folders and i want to find which is searchable pdf and which is not searchable pdf , want to separate searchable and not searchable pdf
    and i want to copy or cut all pdf files from folders and sub folders and paste it into one single folder

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    I didn't get your words
    i want to find which is searchable pdf and which is not searchable pdf
    Can you explain the difference between those two kinds of PDFs?

  13. #13
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    Difference is ocr done (searchable pdf )and not done ocr (not searchable pdf)

  14. #14
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    I have no idea how to differentiate between those two kinds of PDFs
    I recommend that you post new thread with this new request ...

  15. #15
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    ok thank you so much for your help

  16. #16
    Registered User
    Join Date
    01-29-2016
    Location
    india
    MS-Off Ver
    ms office 2013
    Posts
    39

    Re: prefix folder name to files with excel vba

    One more last help how do i copy or cut pdf files from folders and subfolders into one single folder.

  17. #17
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: prefix folder name to files with excel vba

    Try this version
    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. [SOLVED] Excel VBA code for selecting a folder then search & open specified files in that folder
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2021, 03:09 AM
  2. [SOLVED] VBA code to add a prefix in all pdf files in a folder
    By UPA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2018, 01:53 AM
  3. Load all files with certain prefix into Excel Sheet
    By rjj920 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2016, 05:07 PM
  4. [SOLVED] How to put Prefix in filenames on all files in folder with Modified Date
    By junmishima in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2013, 08:47 PM
  5. Replies: 1
    Last Post: 01-24-2006, 11:35 AM
  6. Replies: 1
    Last Post: 01-24-2006, 11:00 AM
  7. Replies: 1
    Last Post: 01-24-2006, 12:25 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