Saving File with information from Text Box

G

Guest

I have several text boxes in a user form and I want to use information from
those text boxes as part of the file name. For example:
TextBox1\TextBox2.xls. How do I get the data from the text boxes to be
recognized by excel so it will save the file?
 
T

Tom Ogilvy

Dim sStr1 as String, sStr2 as String
sStr1 = Userform1.Textbox1.Text
sStr2 = Userform1.Textbox2.Text

ActiveWorkbook.SaveAs sStr1 & "\" & sStr2 & ".xls"

You also might want to look at GetSaveAsFileName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top