Blogs

Litigation Support Tool Tip – Create Folders from a List in Excel

By Amy Bowser-Rollins posted 02-09-2021 11:30

  

Please enjoy this blog post tip from Amy Bowser-Rollins, Instructor, Litigation Support Guru.

In litigation support, we try to leverage Excel’s functionality for numerous tasks.

In eDiscovery matters, we collect electronic data from multiple custodians. We usually create a folder for each custodian name to store their incoming data. Additionally, we create folders for deponent names or trial witnesses.

Often these lists of names already exist in an Excel file or a Word document. What if you could add that list of names into Excel, copy and paste some VBA code, push a button, and have the folders created auto-magically for you!

Let’s walk through the steps:
1) Create a parent folder where all of the new folders will be created.
2) Create an Excel workbook and add the list of names to the first worksheet.
3) Save the Excel workbook into the parent folder from step 1.

4) Select all of cells that contain the names.
5) While the cells are selected, press both the Alt key and the F11 key together (Alt-F11) to open the VBA window.


6) From the Insert menu, select Module.


7) Copy and paste this VBA code into the module window.

Sub MakeFolders()
Dim Rng As Range
Dim maxRows, maxCols, r, c As Integer
Set Rng = Selection
maxRows = Rng.Rows.Count
maxCols = Rng.Columns.Count
For c = 1 To maxCols
r = 1
Do While r <= maxRows
If Len(Dir(ActiveWorkbook.Path & "\" & Rng(r, c), vbDirectory)) = 0 Then
MkDir (ActiveWorkbook.Path & "\" & Rng(r, c))
On Error Resume Next
End If
r = r + 1
Loop
Next c
End Sub

8) Click the Run/Execute


9) Notice that the folders are created instantly.

10) Bonus Step: If you want to re-use this Excel workbook and save it with the VBA macro included, you can use File, Save As, and select Excel Macro-Enabled Workbook (*.xlsm) as the file type.

 

**If you’re a visual learner, I created a video tutorial for this tip. 

 


#LitigationSupportoreDiscovery
#Firm
#NewtoLegal
#ProfessionalDevelopment
#Practice Management and Practice Support
#Training
#Microsoft
1 comment
50 views

Permalink