Filename containing cell values

  • Thread starter Thread starter bluegrassstateworker
  • Start date Start date
B

bluegrassstateworker

Hello,
Has anyone experience with passing cell parameters to a file name using
a button and VB? I have a spreadsheet I am using to send out to
multiple individuals to collect data and need a consistent format to
help manage the files that I will be receiving via email.

Here is what I have in mind: There are three cells containing data that
I would like to concatenate into a file name for my spreadsheet. The
filename would end up being something like: cell1_cell2_cell3_date.xls.
Finishing the data entry, the user would click on a button within the
spreadsheet, then click on the OK button in the SaveAs window. The
next step would involve code that emails the spreadsheet as an
attachement (this is done already). We are all on the same version of
Outlook and Excel so compatibility is not an issue. Any ideas?

Thanks.
 
Sub myfilename()
For i = 1 To 3
mfn = mfn & Cells(i, "I")
Next
mfn = mfn & "date.xls"
MsgBox mfn
End Sub
 

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

Back
Top