I'm sure this is really simple, but I've tried different syntax (guessing) to no avail. Basically, I have a userform that will allow people to choose a folder location from a combobox and then specify their own file name, with the rest of the path being predetermined in the macro. I did this to reduce the number of mistakes people make when filling out a template form and saving it as a regular .xlsx. The macro also does a few simple things such as deleting the commandbutton and resizing/un-freeze paning the first row before it gets saved.
Private Sub SaveButton_Click()
'Turns off pop-up window asking if you're aware saving as a .xlsx file type will remove the macros in this workbook
Application.DisplayAlerts = False
'Searches for and deletes the Save button on the worksheet
Dim myshape As Shape
For Each myshape In ActiveSheet.Shapes
If myshape.Type = 12 Then myshape.Delete
Next myshape
'Selects and turns off the freeze paned row
Rows("1:1").Select
ActiveWindow.FreezePanes = False
'Resizes the first row to default size so it looks like the button was never there
Rows("1:1").RowHeight = 15
'Selects cell A1 so nothing is hilighted
Range("A1").Select
'Saves the current workbook as a .xlsx (macro-free) workbook
ActiveWorkbook.SaveAs "\\server01\mycompanyname\PUBLIC\PERSONAL FOLDERS\Test Save Location\" & ComboBox1.Value "\" & TextBox1.Value, FileFormat:=51
'Closes the userform (popup save window)
Unload Me
End Sub
The issue lies within the "\" between the combobox and textbox values (I get a syntax error). What would be the proper way of phrasing it to insert the backslash?
Thanks, all!
Bookmarks