+ Reply to Thread
Results 1 to 8 of 8

Loop through cells in selected range and delete file from path in cell

  1. #1
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Loop through cells in selected range and delete file from path in cell

    I have a Application that list all files in selected folder and subfolders.
    In Column G each cell has the path to each file.

    I would like to select a range in column G and loop though each cell and kill file from path in cell.
    I hope some one can help me with this, thanks in advance


    Udklip.JPG

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Loop through cells in selected range and delete file from path in cell

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Loop through cells in selected range and delete file from path in cell

    Thanks Fluff13
    The G & Rows.Count will Kill every file.

    I would like to Sort the Table and just select the files in Column G I want deleted.

    Something like this:
    Please Login or Register  to view this content.
    Is that possible

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Loop through cells in selected range and delete file from path in cell

    Yup, just use
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Loop through cells in selected range and delete file from path in cell

    Thanks Fluff13

    So far so good, it works
    But I would like to make sure that the selection is in Column ("G")
    I tried with
    Please Login or Register  to view this content.
    But I get an Error



    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Loop through cells in selected range and delete file from path in cell

    How about
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Loop through cells in selected range and delete file from path in cell

    Thanks Fluff13

    It is perfect :-)

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Loop through cells in selected range and delete file from path in cell

    You're welcome & thanks for the feedback

+ 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. Open file path from cell, paste into new sheet named from another cell and loop
    By LAUGHINGCROW in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2019, 12:09 PM
  2. Trying to populate a cell with a file path within a loop
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-22-2016, 03:20 PM
  3. Need to play a wav file based on path and filename in a selected cell using macro: SOLVED!
    By needtoregistersux in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-31-2016, 07:47 PM
  4. VBA code to loop through a range of selected cells, to add to my macro
    By craig schultz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2014, 10:30 AM
  5. Loop backwards through selected range - delete entire row from selected cells
    By scottbass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 09:21 AM
  6. Delete certain cells in a range WITHOUT loop.
    By Karlos1544 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-28-2013, 07:52 AM
  7. [SOLVED] Delete/empty cells in selected range every Nth row
    By vemix in forum Excel General
    Replies: 1
    Last Post: 10-06-2012, 07:08 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