Split Excel worksheet by row into a different file and have that file within its own new folder

Occasional Visitor

Good afternoon all, 


I am having a to an asset review with 400 individual items. I have a master excel worksheet with all of the items listed by row. I want to take each row and save it as a .txt or .rtf file. The file can be in an another format I suppose as long as our team can have the data from each row be searchable with the "search" box of the folder holding all 400 of the individual files. Then that file will go into its own new folder and be labeled but the asset number in column "A" from the master worksheet. Reasoning is our team will be taking photos of the assets and saving them within the specific asset number folder. 


I found how I can make the folders (below) named by Column A in the master sheet but don't know how to get the searchable identifiers I need in there as well. 


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
Next c
End Sub
0 Replies