Hello,
I copied a macro to create a folder which works very well, however I need a validation before to create the folder. if the folder exist I like to have message that indicates this folder exist and it is not possible to create, if not exist, the macro create a new folder. How can I do that.
The macro I'm using is :
Sub folderc()
Const myFolder As String = "G:\Marketing\Consumer Insight\"
With Worksheets("sheet1").Range("a1")
On Error Resume Next
MkDir myFolder & .Value
On Error GoTo 0
ThisWorkbook.SaveAs Filename:=myFolder & .Value & "\" & .Value & ".xls"
End With
End Sub
Thanks in advance for your help
Regard
Diego
I copied a macro to create a folder which works very well, however I need a validation before to create the folder. if the folder exist I like to have message that indicates this folder exist and it is not possible to create, if not exist, the macro create a new folder. How can I do that.
The macro I'm using is :
Sub folderc()
Const myFolder As String = "G:\Marketing\Consumer Insight\"
With Worksheets("sheet1").Range("a1")
On Error Resume Next
MkDir myFolder & .Value
On Error GoTo 0
ThisWorkbook.SaveAs Filename:=myFolder & .Value & "\" & .Value & ".xls"
End With
End Sub
Thanks in advance for your help
Regard
Diego