create multiple folders and name them by cells in a column excel vba
I have a workbook with student information. I want to grab each last
name to name folders where thier files can be stored. there are about 1000 names, some are repeats (ex adams, mike and adams, jeff). can this be done? |
create multiple folders and name them by cells in a column excel vba
sseyerle,
I would use full names, just for clarity - but, in any case, paste this code into a regular codemodule of a new workbook, save the workbook into the parent folder where you want all the new folders, select the cells with your desired folder names and run this macro. HTH, Bernie MS Excel MVP Sub MakeFolders() Dim myC As Range On Error GoTo FolderExists For Each myC In Selection MkDir ThisWorkbook.Path & "\" & myC.Value ResumeHe Next myC Exit Sub FolderExists: Resume ResumeHere End Sub "sseyerle" wrote in message ... I have a workbook with student information. I want to grab each last name to name folders where thier files can be stored. there are about 1000 names, some are repeats (ex adams, mike and adams, jeff). can this be done? |
All times are GMT +1. The time now is 06:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com