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 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 Contents: Objective Example to find all .xlam files …

VBA Loop Through XLAM 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 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. Table of Contents: Objective Example to find all .XML …

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 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. Table of Contents: Objective Example to find all .CSV …

VBA Loop Through all CSV 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 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 Contents: Objective Example to find all .PDF files …

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 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. Table of Contents: Objective Example to find all .xls …

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 using File System Object(FSO) and built-in Dir() function. VBA for each file in sub-folder macro helps us to loop through all files in sub-folders. In this tutorial we loop through sub-folders and list all available files in sub-folders using FSO early-binding and late-binding method and Dir() function. There …

VBA Loop Through all Files in subfolders Read More »

Get Current Working Directory in Excel using VBA

Get Current Working Directory

Get current working directory using VBA in Excel 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: Objective Macro to find current working directory using VBA CurDir Function Case study on Get current working …

Get Current Working Directory in Excel using VBA Read More »