Save automatically as a different name that changes by formula!


Posted by MOI on June 27, 2001 12:05 AM

Can somebody tell me how to use a macro which saves automatically as a a name that's linked to a cell that changes everytime. So that it automatically saves everytime under a different name when activating a macro. For example when cell A1 is "name1" that it will save under that name and when it changes to "name2" that it will be saved as that, and so on. I don't know if it matters but the cell that contains the name that has to be saved as, is a cell with a formula. And this formula makes it that the cell has a different name everytime. So I hope someone can help me with this problem. Thanks.

MOI

Posted by Dax on June 27, 2001 2:17 AM


hi moi,

Try this:-
Sub SaveByCell()
Dim sFileName As String
sFileName = Sheets("Sheet1").Range("A1")
If sFileName = "" Then Exit Sub
ThisWorkbook.SaveAs "C:\" & sFileName
End Sub

Regards,
Dax.



Posted by MOI on June 27, 2001 6:03 AM

Hi Dax,

Thanks Man!!! It works! Thanks sooo much!!!

MOI