File – Directory Functions

VBA File and Directory Functions can be use to handle with files, folders and directories. These are ChDir, ChDrive, CurDir, Dir, FileAttr, FileCopy, FileDateTime, FileLen, GetAttr, Kill, MkDir, Name, RmDir, SetAttr etc. These functions are Built-In functions. We can use these VBA File and Directory functions in either procedure or function. These functions we use in the VBA editor window in Excel. These File and Directory functions you can use any number of times in VBA macro codes.

We use these functions to create,delete, or rename folders. Store files in created folders. You can organize files, folders and directories.

Click on the following link to learn VBA File and Directory Functions in Excel.

VBA File and Directory Functions in Excel

VBA Loop Through XLAM Files in a Folder

VBA Loop Through XLAM Files in a Folder

VBA Loop Through XLAM Files in a Folder VBA Loop Through xlam Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .xlam files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. Table of …

VBA Loop Through XLAM Files in a Folder Read More »

VBA List all XLSX Files in a Folder

VBA List all XLSX Files in a Folder VBA List all xlsx Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .xlsx files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. Table of …

VBA List all XLSX Files in a Folder Read More »

VBA Loop Through TXT Files in a Folder

VBA Loop Through TXT Files in a Folder

VBA Loop Through all TXT Files in a Folder VBA Loop Through all TXT Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .TXT files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. …

VBA Loop Through TXT Files in a Folder Read More »

VBA Loop Through all XML Files in a Folder

VBA Loop Through all XML Files

VBA Loop Through all XML Files in a Folder VBA Loop Through all XML Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .XML files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. …

VBA Loop Through all XML Files in a Folder Read More »

VBA Loop Through all CSV Files in a Folder

VBA Loop Through all CSV Files in a Folder

VBA Loop Through all CSV Files in a Folder VBA Loop Through all CSV Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .CSV files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. …

VBA Loop Through all CSV Files in a Folder Read More »

VBA Find all XLSM Files in a Folder

VBA Find all XLSM Files

VBA Find all XLSM Files in a Folder VBA Find all XLSM Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .XLSM files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. Table of …

VBA Find all XLSM Files in a Folder Read More »

VBA Loop Through PDF Files in a Folder

VBA Loop Through all PDF Files in a Folder in Excel

VBA Loop Through PDF Files in a Folder VBA Loop Through PDF Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .PDF files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. Table of …

VBA Loop Through PDF Files in a Folder Read More »

VBA Loop Through all XLS Files in a Folder

VBA Loop Through all xls Files in a folder

VBA Loop Through all XLS Files in a Folder VBA Loop Through all xls Files in a Folder using built-in Dir() function. In this tutorial we loop through a folder or directory and list all available .xls files in a folder. Lets learn how to use Dir, Right and Len VBA functions in this tutorial. …

VBA Loop Through all XLS Files in a Folder Read More »

VBA Loop Through all Files in subfolders

VBA Loop Through all Files in subfolders

VBA Loop Through all Files in subfolders VBA Loop Through all Files in subfolders using File System Object(FSO) and built-in Dir() function. VBA for each file in subfolder macro helps us to loop through all files in subfolders. In this tutorial we loop through subfolders and list all available files in subfolders using FSO early-binding …

VBA Loop Through all Files in subfolders Read More »

Get Current Working Directory in Excel VBA

Get Current Working Directory

Get current working directory using VBA Get current working directory using VBA explained with examples. We use CurDir VBA function to find current working directory or folder. It displays system default directory. It can be changed using ChDir function. Table of Contents: Overview of Get current working directory using VBA Macro to find current working …

Get Current Working Directory in Excel VBA Read More »