I would like to modify the below so that the contents of cell D2 of the current file becomes the file name.
Thanks for any help
Phil
Sub FlattenSS()
'
' FlattenSS Macro
'
''
ActiveSheet.Select
ActiveSheet.Copy
ActiveSheet.Unprotect
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ChDir "C:\Documents and Settings\philip.marshall\Desktop"
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
End If
End Sub
Bookmarks