Create folders programmatically with MS Excel

ADMAT Bandara
3 min readFeb 16, 2019

--

One of my best friends wanted a software which will generate folders based on an excel sheet.

Guess what I suggested ? Initially Ruby πŸ˜… because I just ❀ it

later, I remembered the most easiest way.

And that is using The Macro feature in Ms Excel.

I am writing this article to explain how you can create your own macro to create folders based on an excel column.

1. Add developer option into your Ms Excel

I hope you have already opened the Ms Excel :). And also skip this step if you have the developer option like bellow in the ribbon.

Ribbon with the developer option

File β†’ Options

Select Customize Ribbon β†’ Tick the developer option

2. Do the Macro

Developer β†’ Visual Basic

This will open a new window. like this

Visual Basic window

Now you have to create a new Module for the task

So Insert β†’ Module

New module

Now Insert the code to generate the folders based on the selected column names

Save it by whatever a name. πŸ˜„

3. Last part using a HAPPY DEMO

Go to your excel sheet, type some random names in the sheet.

select the names

Go to developer β†’ Macros

Macros Window

I saved the Macro as MakeFolders,

Just RUN it and see the magic. ❀

Folders created successfully

Enjoy !!!

Happy macro with Excel ❀

--

--