Hi All,
I have a userform with two textbox.....
The value will be entered based on the file location which the user choose.
Suppose, for example it can be "
If this is choosen as the input file Directory,i need to create another directory in the same location like thisC:\Documents and Settings\E701152\Desktop\Final_Excel_project\Q2Y580-05.xls
so the logic is i must extract all the text before the second '\' from the end and then create a directory named Output_directory,then the same filename as Input file name,C:\Documents and Settings\E701152\Desktop\Output_Directory\Q2Y580-05.xls
I need to achieve this using VBA code...
Can someone help me with this.
Regards
Ashesh
Try this
vecPath = Split(TextBox1.Text, "\") ReDim Preserve vecPath(LBound(vecPath) To UBound(vecPath) - 2) newPath = Join(vecPath, "\") & "\Output_Directory" MkDir newPath
Hi Phillips,
Am getting an object required error ar
vecPath = Split(TextBox1.Text, "\")
Maybe your textbox is not called TextBox1.
Hi Phillips,
It worked fine......thanx a lot for ur help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks