Aqui está a macro.
- Verifique se a planilha com as datas de ID do projeto e Início está em exibição (selecionada) antes de executar a macro.
-
Defina a pasta onde você deseja criar essas pastas em ParentFolderPath
Sub CreateFolders() 'Variable definations Dim FolderListRange As Range Dim FolderRange As Variant Dim FolderName As String Dim ParentFolderPath As String On Error GoTo Handle ' Set the Folder where the individual folders should be created ParentFolderPath = "Folders" Set FolderListRange = ActiveSheet.Range("A2:A64000").SpecialCells(xlCellTypeConstants) For Each FolderRange In FolderListRange If FolderRange.Offset(0, 1).Value = "" Then GoTo Continue FolderName = ParentFolderPath & "\" & FolderRange.Value & "-" & Format(FolderRange.Offset(0, 1).Value, "dd-mm-yyyy") If FileSystem.Dir(FolderName, vbDirectory) = vbNullString Then FileSystem.MkDir FolderName End If Continue: Next Handle: End Sub