Saving a file as two cell reference ???


Posted by Marc on April 21, 2001 4:05 PM


Hi

I would like to know if it's possible to save a workbook
Using two cells as reference, I know we can do it with one cell but two ?

Sub SaveMe()
Application.ActiveWorkbook.SaveAs Sheets("Sheet1").Range("I11").Value
End Sub


Thanks
Marc

Posted by Steve W on April 21, 2001 5:09 PM

Hi marc
Have you tryed useing the concatenate function in I11 to merge data from two cells together.

Not sure if this will work but try

("Sheet1").Range("I11").Value & ("Sheet1").Range("I12").Value


steve

Posted by Marc on April 21, 2001 9:26 PM

No :( It did not Work !

Thank's for your help anyway .

regards
Marc

Posted by Aladin Akyurek on April 22, 2001 12:03 AM

Marc

Would it not work, if you first build by means of a formula (with CONCATENATE or &) whatever you need in the cell to which your VBA code refers to?

Aladin

Posted by anon on April 22, 2001 1:32 AM


Application.ActiveWorkbook.SaveAs Sheets("Sheet1").Range("I11").Value & Sheets("Sheet1").Range("I12").Value




Posted by Dave Hawley on April 22, 2001 2:52 AM

This does..

Hi Marc

This code will work, if not your cells may contain invalid characters.

Sub SaveAsCells()
Dim MyFileName As String

With Sheets("Sheet1")
MyFileName = .Range("A1") & .Range("A2") & ".xls"
End With

ThisWorkbook.SaveAs MyFileName
End Sub


Dave

OzGrid Business Applications