Create the list of Files and Sub-folders in a Folder in Excel (Macro to list File Names)

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 44

  • @krishnamaruthipeddinti2024
    @krishnamaruthipeddinti2024 7 месяцев назад

    Thank you verymuch . this is really nice and useful. I have a little further query. If 5 folders are having multiple sub folders. how should i take all sub folders in a side by side row? please help me to get the code.

  • @ezelkarlkl1284
    @ezelkarlkl1284 3 года назад +1

    Thank you very much for this video. How can we do same things for FOLDER and SUBFOLDER names with file names ?

  • @haddadikram
    @haddadikram 2 года назад +3

    Sub ListFileNames()
    Dim X As Object, XNC As Object
    Dim Y As Integer

    Set X = CreateObject("Scripting.filesystemobject")
    Set XNC = X.GetFolder(Range("B2").Value)

    For Each Z In XNC.Files

    Y = Y + 1
    Worksheets("File Names").Cells(Y + 1, 5).Value = Z.Name
    Worksheets("File Names").Cells(Y + 1, 6).Value = Z.Path

    Next


    End Sub

  • @rajagopalanpk1546
    @rajagopalanpk1546 4 года назад +4

    Sir, Thank you very much . Can you also explain how do you populate the Serial Numbers in your Final execution of the macro automatically in Column D? It is not visible as a Macro Code.

    • @AjayAnandXLnCAD
      @AjayAnandXLnCAD  4 года назад +4

      I appreciate that you noticed it. The serial numbers in the Column D are created using 2 formulas.
      Formula in the cell D2 is =IF(E2"",1,"")
      if the cell E2 is not blank, return 1, otherwise return nothing.
      Formula in the cell D3 is =IF(E3"",D2+1,"")
      means if the cell E3 is not blank, return value in the cell D2+1, otherwise return nothing.

    • @OfficialRoot
      @OfficialRoot Год назад

      @@AjayAnandXLnCAD на русском:
      D2 =ЕСЛИ(E2="";"";1)
      D3 =ЕСЛИ(E3="";"";D2+1)

  • @vincysigma
    @vincysigma 3 года назад

    Wonderful coding...Thank you Ajay.

  • @rahulkamble4737
    @rahulkamble4737 3 года назад

    Really nice video.. I have use this code in my excel but and only getting name for folders but not getting name for all the sub folders or folder which is created under subfolder.. So for this any changes required in code please let me know

  • @annafranz7354
    @annafranz7354 4 года назад +1

    Thank you so much. It was very helpful!

  • @adrianjeffery497
    @adrianjeffery497 4 года назад +1

    Thank you so much ! Its so informative

  • @anmac6910
    @anmac6910 3 года назад +2

    I want to create a list of the parent folder of my selection, including the subfolders and and deeper nested folders and all files across all levels of directories. I also want them to be organized by Date created, date modified, size, type, name and path. How can I do this with excel vba? I have windows 10 with microsoft 365. Thanks

  • @anhnhatnguyet4628
    @anhnhatnguyet4628 3 года назад

    Very great. Thank you

  • @isaiass.1951
    @isaiass.1951 4 года назад +2

    Thank you so much... i was trying do this today and my code didn't working anyway... I'm from Brazil and you channel is help me so much....

    • @AjayAnandXLnCAD
      @AjayAnandXLnCAD  4 года назад

      Glad to hear that. I recommend to visit my website for more VBA codes and a free ebook.

  • @danielle03201
    @danielle03201 3 года назад

    Thank you this is very useful section. Can you do one section on how to list out all external links i.e folder , file name in one workbook please?

  • @10morrisonka
    @10morrisonka 5 лет назад +2

    Thank you, Ajay, for those sandwiches !!
    By the way, excellent work ! 💖💖💖

  • @amitoswal3193
    @amitoswal3193 3 года назад

    Hi Ajay, When i try to run ListFileNames Macro it did not work. I tried exactly instructed in your video. I made sure Macro is enabled but still when pressed the Get File Names command button nothing happened.

  • @engineeringinspectionsirel1385
    @engineeringinspectionsirel1385 3 года назад

    Thnx. Very good.

  • @sat1460
    @sat1460 5 лет назад +1

    Nice video ... How to bank reconciliation with cashbook in Excel

    • @AjayAnandXLnCAD
      @AjayAnandXLnCAD  5 лет назад

      Thank you for the feedback.
      I haven't tried cashbook reconciliation in Excel.

  • @OfficialMoin
    @OfficialMoin 3 года назад

    What if I have 100 songs inside a folder and I want to extract the name and also the *_DURATION_* of each song in the excel file?

  • @adrianjeffery497
    @adrianjeffery497 4 года назад

    I also want the file date. How can we add that? Any help please? Thank you

  • @hareshassanali3719
    @hareshassanali3719 3 года назад

    You are super bro ❤️

  • @zuhebkhan6973
    @zuhebkhan6973 4 года назад +1

    Hi Sir Thank u so much for this Video... learnt a lot...plse give what formula used to get automatic SL# in the file..
    Thanks in Advance

  • @daleramsawak4041
    @daleramsawak4041 4 года назад +1

    How can you get the Parent Folder Name, Sub-Folder Name and File Named (hyperlinked) in 3 columns in excel worksheet?

    • @AjayAnandXLnCAD
      @AjayAnandXLnCAD  4 года назад

      I suggest to use SPLITTER function (which I have explained in another video) or the Text to Columns feature for separating Folder and File names.

  • @helpinghandbyvipin2729
    @helpinghandbyvipin2729 3 года назад

    bro can u provide me a vba code that can open all the folder and extract all the specific file names for eg: only pdf.also can u provide me a code that can copy a folder path into destiontion path?

  • @pakkruikkru
    @pakkruikkru 5 лет назад +1

    Thank You Ajay For Considering My Request.

  • @popeyefoodpoint
    @popeyefoodpoint 3 года назад

    Same Option How to Set LibreOffice Calc

  • @RajeshKumar-sb7qn
    @RajeshKumar-sb7qn 3 года назад

    It shows Run time error 438
    It is not working

  • @ashishbhatt06
    @ashishbhatt06 3 года назад

    How can we add Authors name of File ?

  • @umeshadvani8195
    @umeshadvani8195 4 года назад +1

    Hi need your help in creating macro to send chaser mail Or create folder for 3000 line items.

  • @ishwarsinghsisodiya7300
    @ishwarsinghsisodiya7300 3 года назад

    One more easier way to copy folders or files name in excel.... Just select all then press and hold Shift key + right click then look for copy as path and simply paste in excel. Too simple.

  • @mail87suren
    @mail87suren 4 года назад

    coudl it be possible to move multiple PDF files to respective subfolders which created in another path based on PDF name or number