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.
Bookmarks