Dear all,
I would like to know if it is possible to create a folder, save a general workbook on it based on cell values and conditions "IF". Below I've putted my line of thought. I hope it helps you to help me on this one!
Thank you so much in advance!
Best Regards,
Tiago
Sub Create_Folder_Save_Excel_workbook()
Lookup - Last Value on column Y
Than, use references on the last line (last value found at column Y).
If Colum X = "DT", than create folder as:
On Error Resume Next
MkDir "\\s009\mimx\DTMS\DTMS_2013" & Range("E19") & Range("F19") & Range("H19") & Range("L19") & Range("I19") & Range("J19").Value
On Error GoTo 0
If Colum X = "PT", than create folder as:
On Error Resume Next
MkDir "\\s009\mimx\PTMS\PTMS_2013" & Range("E19") & Range("F19") & Range("H19") & Range("L19") & Range("I19") & Range("J19").Value
On Error GoTo 0
Than, Save a copy of an excel workbook on a general folder, into the new one created :
Workbook.SaveAs "MkDir "\\s009\mimx...
finnaly open the new created folder with the excel workbook on it.
Dim str_folder As String
str_folder = "\\s009\mimx\DTMS\DTMS_2013\Europa\França\Budgets\" & Range("G140") & Range("F8") & Range("G141") & Range("G138") & Range("F6") & Range("G138") & Range("M6").Value
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
End Sub
Bookmarks