View Single Post
 
Old 04-02-2023, 11:11 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Doug Robbins posted a macro a long time ago that gives us the basic code which can be adapted to your requirements. I've added an arbitrary limit so your default filename doesn't get too long.
Code:
Sub FeedMeSeymour()
  Dim fd As FileDialog
  Set fd = Application.FileDialog(msoFileDialogSaveAs)
  With fd
    .InitialFileName = Left(Selection.Text, 50)
    If .Show <> 0 Then 'if the user didn't press the cancel button
      .Execute
    End If
  End With
  Set fd = Nothing
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote