Hi,
I'm afraid this will no doubt horrendously basic as I'm a complete newbie to VB and have dived in without learning to do much... Start in the deep end and all.
So if anyone could help, I'd appreciate it;
I've got this bit of code and I couldn't for the life of me tell you why it doesn't work, if anyone else can I'd appreciate it!
Cheers
----------------
Sub Folders()
Directory1
Directory2
End Sub
Sub Directory1()
Application.Scr eenUpdating = False
Worksheets("Sum mary").Activate
Dim cli As String
Dim Job As String
cli = Cells(6, 5).Value
Job = Cells(1, 29).Value
Dim FSO, Folder
Set FSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
Folder = "\\Work\tri al reports\" & cli & " \ "
If FSO.FolderExist s(Folder) Then
MsgBox "Client folder exists, creating job folder for certificate"
Else
MkDir "\\Work\Tri al reports\" & cli & "\"
End If
End Sub
Sub Directory2()
Application.Scr eenUpdating = False
Worksheets("Sum mary").Activate
Dim cli As String
Dim Job As String
cli = Cells(6, 5).Value
Job = Cells(1, 29).Value
Dim FSO, File
Set FSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
File = "\\Work\Tri al reports\" & cli & "\" & Job & "\"
If FSO.FolderExist s(File) Then
MsgBox "Job folder exists, please save certificate when complete"
Else
MkDir "\\Work\Tri al reports\" & cli & "\" & Job & "\"
End If
End Sub
----------------
Thanks again!
Ben
I'm afraid this will no doubt horrendously basic as I'm a complete newbie to VB and have dived in without learning to do much... Start in the deep end and all.
So if anyone could help, I'd appreciate it;
I've got this bit of code and I couldn't for the life of me tell you why it doesn't work, if anyone else can I'd appreciate it!
Cheers
----------------
Sub Folders()
Directory1
Directory2
End Sub
Sub Directory1()
Application.Scr eenUpdating = False
Worksheets("Sum mary").Activate
Dim cli As String
Dim Job As String
cli = Cells(6, 5).Value
Job = Cells(1, 29).Value
Dim FSO, Folder
Set FSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
Folder = "\\Work\tri al reports\" & cli & " \ "
If FSO.FolderExist s(Folder) Then
MsgBox "Client folder exists, creating job folder for certificate"
Else
MkDir "\\Work\Tri al reports\" & cli & "\"
End If
End Sub
Sub Directory2()
Application.Scr eenUpdating = False
Worksheets("Sum mary").Activate
Dim cli As String
Dim Job As String
cli = Cells(6, 5).Value
Job = Cells(1, 29).Value
Dim FSO, File
Set FSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
File = "\\Work\Tri al reports\" & cli & "\" & Job & "\"
If FSO.FolderExist s(File) Then
MsgBox "Job folder exists, please save certificate when complete"
Else
MkDir "\\Work\Tri al reports\" & cli & "\" & Job & "\"
End If
End Sub
----------------
Thanks again!
Ben
Comment