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

%3CLINGO-SUB%20id%3D%22lingo-sub-2261655%22%20slang%3D%22en-US%22%3ESplit%20Excel%20worksheet%20by%20row%20into%20a%20different%20file%20and%20have%20that%20file%20within%20its%20own%20new%20folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2261655%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20afternoon%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20having%20a%20to%20an%20asset%20review%20with%20400%20individual%20items.%20I%20have%20a%20master%20excel%20worksheet%20with%20all%20of%20the%20items%20listed%20by%20row.%20I%20want%20to%20take%20each%20row%20and%20save%20it%20as%20a%20.txt%20or%20.rtf%20file.%20The%20file%20can%20be%20in%20an%20another%20format%20I%20suppose%20as%20long%20as%26nbsp%3Bour%20team%20can%20have%20the%20data%20from%20each%20row%20be%20searchable%20with%20the%20%22search%22%20box%20of%20the%20folder%20holding%20all%20400%20of%20the%20individual%20files.%20Then%20that%20file%20will%20go%20into%20its%20own%20new%20folder%20and%20be%20labeled%20but%20the%20asset%20number%20in%20column%20%22A%22%20from%20the%20master%20worksheet.%20Reasoning%20is%20our%20team%20will%20be%20taking%20photos%20of%20the%20assets%20and%20saving%20them%20within%20the%20specific%20asset%20number%20folder.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20how%20I%20can%20make%20the%20folders%20(below)%20named%20by%20Column%20A%20in%20the%20master%20sheet%20but%20don't%20know%20how%20to%20get%20the%20searchable%20identifiers%20I%20need%20in%20there%20as%20well.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22line%20number1%20index0%20alt2%22%3ESub%20MakeFolders()%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number2%20index1%20alt1%22%3EDim%20Rng%20As%20Range%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number3%20index2%20alt2%22%3EDim%20maxRows%2C%20maxCols%2C%20r%2C%20c%20As%20Integer%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number4%20index3%20alt1%22%3ESet%20Rng%20%3D%20Selection%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number5%20index4%20alt2%22%3EmaxRows%20%3D%20Rng.Rows.Count%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number6%20index5%20alt1%22%3EmaxCols%20%3D%20Rng.Columns.Count%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number7%20index6%20alt2%22%3EFor%20c%20%3D%201%20To%20maxCols%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number8%20index7%20alt1%22%3Er%20%3D%201%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number9%20index8%20alt2%22%3EDo%20While%20r%20%26lt%3B%3D%20maxRows%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number10%20index9%20alt1%22%3EIf%20Len(Dir(ActiveWorkbook.Path%20%26amp%3B%20%22%5C%22%20%26amp%3B%20Rng(r%2C%20c)%2C%20vbDirectory))%20%3D%200%20Then%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number11%20index10%20alt2%22%3EMkDir%20(ActiveWorkbook.Path%20%26amp%3B%20%22%5C%22%20%26amp%3B%20Rng(r%2C%20c))%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number12%20index11%20alt1%22%3EOn%20Error%20Resume%20Next%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number13%20index12%20alt2%22%3EEnd%20If%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number14%20index13%20alt1%22%3Er%20%3D%20r%20%2B%201%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number15%20index14%20alt2%22%3ELoop%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number16%20index15%20alt1%22%3ENext%20c%3C%2FDIV%3E%3CDIV%20class%3D%22line%20number17%20index16%20alt2%22%3EEnd%20Sub%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2261655%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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
Loop
Next c
End Sub
0 Replies