In this article we are going to show you how you can delete file or files using a single line of VBA code.
Kill "E:\Work\ExcelSirJi\ Test 3.txt"
For example, you may want to delete all .txt files from the folder and do not want to delete any other types of files.
Kill "E:\Work\ExcelSirJi\*.txt"
Kill "E:\Work\ExcelSirJi\*"
The code will delete file(s) from the given folder
Thanks for reading the article, subscribe us to get more VBA tricks
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
In this article we will learn about VBA code to get computer name. Excel VBA, or Visual Basic for Applications, is a programming language that can be used to automate tasks within the Microsoft Excel…
How to use VBA to open Workbook in Excel? There are few VBA codes which are commonly used by every developer. One of them is giving an option to user to browse a file. Below is a…
VBA Code to Browse a Folder Quite often a VBA developer requires code to browse a folder. This is mainly for saving the output file or reading the input file(s). Below is the VBA code…
VBA CODE TO HIDE MENU RIBBON IN MS ACCESS In MS Access, there are multiple ways to protect your code or tool from un-authorized access and edits. Some developers prefers to hide MS Access ribbons…
What is the Usage of sheet color in Excel? When we prepare a report or a dashboard it is easy to identify or analyze reports with a change of color sheet tabs. Analysts generally give…
In MS Access, the best way to create a multiuser tool is to divide your solution. One part acts as interface and other one acts as database. You can have multiple copies of the interface distributed to users which are connected to central MS Access database saved at common shared drive. To connect the interface to database, you can use link table feature (Access>External Data>Import & Link) available in MS Access. Below is a commonly required VBA code which helps the developers to re-link MS Access linked tables when the database is renamed or moved to other location
Could you kindly please send the VBA code how to deleteor files using a single line of VBA code my email address [email protected]
Just want to check, are you not able to copy the codes from the article. You can use these same codes for your requirements. Let us know if you have any other challenges.