MistakesWereMade
Board Regular
- Joined
- May 22, 2019
- Messages
- 103
I have a commandbutton_click sub that I would like to code so that a folder is created. Is there a way to call on a function/sub and to have it run its code and then go back to the commandbutton_click sub to finish?
The function is below...
The function is below...
Code:
Function MkDir(strDir As String, strPath As String)
Dim fso As New FileSystemObject
Dim path1 As String
'examples for what are the input arguments
strDir = thisMonday & " Thru " & thisSunday
strPath = Environ("Userprofile") & "\Desktop\bn9\"
path1 = strPath & strDir
If Not fso.FolderExists(path1) Then
' doesn't exist, so create the folder
fso.CreateFolder path1
End If
End Function