Hi All,
I have a query. Please find attached sheet. In attached sheet I put a function for today’s date (which is =today()), next to this one command button with name ‘Create Folder’.
What I want to achieve is, when I click on command button excel create a folder with the cell value in B2 (which is 2day’s date).
I have written this code but it’s not working.
Can anyone help me with this?
Thanks
Private Sub CommandButton1_Click()
MakeFolders
End Sub
Sub MakeFolders()
Dim x As String
With ActiveSheet
x = .Range("B2").Value
If x > 0 Then
MkDir (ActiveWorkbook.Path & "H:\Others\VBA\" & x("B2"))
End If
End With
End Sub
Bookmarks