You are on page 1of 2

Sub Show_Form()

frmForm.Show

End Sub

Function Selected_List() As Long

Dim i As Long

Selected_List = 0

For i = 0 To frmForm.lstDatabase.ListCount - 1

If frmForm.lstDatabase.Selected(i) = True Then

Selected_List = i + 1
Exit For
End If

Next i

End Function
_________________

Private Sub WorkSheet_Change(ByVal Target As Range)

Dim Z As Long

Dim xVal As String

On Error Resume Next

If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub

Application.EnableEvents = False

For Z = 1 To Target.Count

If Target(Z).Value > 0 Then

Call MakeFolders

End If

Next

Application.EnableEvents = True

End Sub
_______________________________
Dim Newfolder As String, path As String
Dim startPath As String
Dim myName As String
startPath = "C:\Users\earld\Desktop\Therapy\Record\"
myName = ActiveSheet.Range("A1").Text
If myName = vbNullString Then myName = Sheet1.txtName.Text

Dim folderPathWithName As String


folderPathWithName = startPath & Application.PathSeparator & myName

If Dir(folderPathWithName, vbDirectory) = vbNullString Then


MkDir folderPathWithName
Else
MsgBox "Folder already exists"
Exit Sub
End If

_____________________________________________
Dim startPath As String
Dim myName1 As String

startPath = "C:\Users\earld\Desktop\Therapy\Record\"
myName1 = ActiveSheet.Range("A1").Text

Dim folderPathWithName As String


folderPathWithName = startPath & Application.PathSeparator & myName1 & " " &
Sheet2.Range("B2")
If Dir(folderPathWithName, vbDirectory) = vbNullString Then
MkDir folderPathWithName
Else
MsgBox "Folder already exists"
Exit Sub
End If

You might also like