View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pierre Pierre is offline
external usenet poster
 
Posts: 149
Default Set initial filename before saving

When a new workbook is created from a template the proposed (initial)
filename when saving the workbook is the "template name".xls. I would like
to have this proposed name (initial name) to be equal to cell content. Would
you please help me with the coding.

Here is what I have so far:

Private Sub Worksheet_Change(ByVal Target As Range)
'
' How do I run a macro every time a certain cell changes its value?
' Event called Worksheet_Change which is triggered when a
' value is entered (it will not fire when a formula result changes).


' If Intersect(Target, Range("A2")) Is Nothing Then
' Exit Sub
' Else
' Call Set_InitialFname
' End If

End Sub
----------

Sub Set_InitialFname()
'
' Propose a preset file name when the user will save the file
'
' Set the initial file name before saving
? =Range("A2").Value & ".xls"

End Sub