Userform Save data To Worksheet & File
Here is some code to get you basically what you want. Instead of hard
coding the string names, you could replace with
Me.TextBox1.Value or whatever your case is.
Sub addfilefolder()
Dim folderPath As String
Dim fileName As String
folderPath = "C:\Users\kurtz\Desktop\test"
fileName = TextBoxJobNumber.Value & ".xlsx"
Workbooks.Add
MkDir folderPath
ActiveWorkbook.SaveAs Filename:=folderPath & "\" & fileName
Workbooks(fileName).Close
End Sub
Hope this helps
dk
|