I want to be able to select and cell in a column and have the macro use that cell value and offset values to create folder and folders inside that folder.
should look like this folder name "2021-07-26 - 000717171717Z01 - william - bike"
This would be inside "MyWork" folder.
Sub CreateMyFolderMy()
Dim MyFile4 As String
Dim dDir4 As String
Dim dDir6 As String
Dim dDir7 As String
Dim fdObj As Object
MyFile4 = ActiveCell.Value & " - " & ActiveCell.Offset(columnOffset:=3) & " - " & ActiveCell.Offset(columnOffset:=4) & " - " & ActiveCell.Offset(columnOffset:=5)
sDir4 = _
"C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4
dDir4 = _
"C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Images"
dDir6 = _
"C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Sentery Pak"
dDir7 = _
"C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Race Files"
Application.ScreenUpdating = False
Set fdObj = CreateObject("Scripting.FileSystemObject")
If fdObj.FolderExists("C:\Users\" & Environ("username") & "\Desktop\MyWork") Then
MkDir sDir4
MkDir dDir4
MkDir dDir6
MkDir dDir7
MsgBox "Click on Open MyWork Button to view Folder To Open Folder.", vbInformation, "My Folder Creater"
Else
fdObj.CreateFolder ("C:\Users\" & Environ("username") & "\Desktop\MyWork")
MsgBox "MyWork Folder has been created and is on your Desktop.", vbInformation, "My Folder Creater"
MkDir sDir4
MkDir dDir4
MkDir dDir6
MkDir dDir7
End If
Application.ScreenUpdating = True
End Sub
Bookmarks