Results 1 to 7 of 7

Save a workbook to a folder path in textbox2 using textbox1 as filename

Threaded View

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    33

    Talking Save a workbook to a folder path in textbox2 using textbox1 as filename

    Hi Guys,

    I have a deadline and I really need your help!!

    My userform1 has two textbox. Texbox1 is where the user put's his/her name, and textbox2 is where the user put/browse the folder path where to save the newly generated workbook. I want the new workbook to be saved in the path defined by the user in textbox2 with filename sequence (Textbox1_Accounting_Todaysdate) and with file extension of only .xls and .xlsx.

    VBA code for the "Browse" button which returns the folder path in textbox2:

    Private Sub Browsebutton_Click()
    Dim pathSelected As String
    
    Dim ShellApp As Object
    Set ShellApp = CreateObject("Shell.Application"). _
    BrowseForFolder(0, "Choose a folder", 0, OpenAt)
    pathSelected = ShellApp.Self.Path
    Me.output.Text = pathSelected
    Set ShellApp = Nothing
    Exit_CommandButton1_Click:
    
    Exit Sub
    
    Err_CommandButton1_Click:
    
    MsgBox Err.Description
    
    Resume Exit_CommandButton1_Click:
    
    End Sub.

    I am not really sure what to put in "Submit" button.

    For now my submit button have this:

    Private Sub Submit_Click()
    
    Workbooks.Add
    
    (and a bunch of VBA code for accounting)
    
    (VBA to save???) 
       
    End Sub
    Thanks
    sorry for my bad english

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 09-23-2013 at 11:49 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Is there a way of gettting the path of a filename in any folder
    By all4excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-28-2021, 09:53 PM
  2. [SOLVED] Cell Value = TextBox1.Value + TextBox2.Value
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2013, 09:30 AM
  3. [SOLVED] textbox1 * textbox2 = textbox3
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-23-2012, 03:35 PM
  4. Choose 4 Random Numbers if they are not textbox1 or textbox2
    By blitz74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2012, 02:41 AM
  5. [SOLVED] TextBox1 = TextBox2
    By Anto_BT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 03:34 AM

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