+ Reply to Thread
Results 1 to 2 of 2

Create a Folder based on Cell Values - Save one general workbook into it and then open it

  1. #1
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Create a Folder based on Cell Values - Save one general workbook into it and then open it

    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

  2. #2
    Registered User
    Join Date
    04-17-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Create a Folder based on Cell Values - Save one general workbook into it and then open

    Dear All,

    I managed do more or less the things above mentioned but I'm getting some errors. Can you please help me correct them?
    Thank you!
    Tiago

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1