Consulting

Results 1 to 4 of 4

Thread: excel file saving issues

  1. #1

    excel file saving issues

    hi,



    I written VBA code in my project. but now i need to add some more lines regarding folder options.

    while running code, first, macro should ask "choose main folder". Then automatically subfolder should create with the name "today's date" (Ex: 12-Feb-2017) in main folder. we need to assign the total path (drive,main folder and subfolder) to any string variable. if main folder drive is "C:\" or any external device then macro should not accept.

    Thank you in advance for helping me.

    regards
    syed
    Last edited by syed_iqbal; 02-11-2017 at 06:24 PM. Reason: i written issue clearly

  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    Option Explicit
    
    
    Sub test()
        Dim myFolder As String
    
    
        With Application.FileDialog(msoFileDialogFolderPicker)
            .Title = "Plesse choose the folder"
            If Not .Show Then Exit Sub
            myFolder = .SelectedItems(1) & "\" & Format(Date, "d-mmm-yyyy")
        End With
        
        If Dir(myFolder, vbDirectory) = "" Then MkDir myFolder
    
    
    End Sub

  3. #3
    hi,

    thanks for reply. i'm sorry to say, you missed some points which i mentioned in my query. Pls share complete code including all conditions/saving restrictions.

  4. #4

    get file paths based on name fro folder

    pls ignore this blank post
    Last edited by syed_iqbal; 02-12-2017 at 04:59 AM. Reason: sorry

Posting Permissions

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