windows - Delete multiple Files in Explorer from Excel -
i'm trying select around 17k files in specific folder containing around 22k list in excel. list has name , extension of files , nothing more.
i've tried code no luck.
sub deletepics() dim picrng range, pic range, picpath string picpath = "path" set picrng = sheets("sheet1").range("a1:a17108").specialcells(xlconstants) on error resume next each pic in picrng if pic.offset(, 1) = "delete" if len(dir(picpath & pic.value)) > 0 kill picpath & pic.value pic.offset(, 2).value = "deleted" else pic.offset(, 2).value = "not found" end if end if next pic end sub
Comments
Post a Comment