• SAVE AS with help of text box (97)

    Author
    Topic
    #371838

    SAVE AS with help of text box
    I

    Viewing 2 reply threads
    Author
    Replies
    • #592264

      hello arage

      I like “is this possible” kind of questions.

      Yes it is possible. Check the Inputbox in the OLH.

      It says that you can have the following parts: InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])

      So you can use the Default section to populate the Inputbox. BUT You should also write some VBA code to move the cursor to the end of the line, so that you can start typing.

      I do have an example, but try it first on your own, until I dig out the example. Its going to take me about 3 weeks to dig it out. I am reorganizing my files and now most of them are on Zip disks.

      Good luck.

      Wassim compute

      • #592268

        Thanks Wassim, I tentatively began work using the inputBox function before Smerdon

    • #592261

      Try this:

      Sub Button1_Click()
      ‘Copies the workbook to a separate file
      Dim FileName As String
      Dim thePath

      thePath = “C:YourDirectoryHere” ‘ That last ” is important
      FileName = “New File ” & Format(Date, “mm-dd-yyyy”) ‘Suggested Filename

      Application.Dialogs(xlDialogSaveAs).Show thePath & FileName ‘ Save As box
      Application.DisplayAlerts = False ‘—–=====—–
      ActiveWorkbook.Close ‘ Comment these out to leave the new file open
      Application.DisplayAlerts = True ‘—–=====—–
      End Sub

    • #592348

      Saving a copy of the current workbook without changing its name can be done using the savecopyas method:

      Sub wkbkSaveAsCopy()
      Dim vFilename As Variant ‘will hold the filename entered
      Dim sOldDrive As String
      Dim sOldDir As String
      sOldDrive = Left(CurDir, 1)
      sOldDir = CurDir
      ChDrive “c”
      ChDir “c:data”
      vFilename = Application.GetSaveAsFilename(“YourDefaultFileName ” & Format(Now, “dd-mm-yyyy”), , , “Please enter a filename”)
      If TypeName(vFilename) = “Boolean” Then GoTo tidyup ‘cancelled
      If vFilename = “” Then GoTo tidyup ‘nothing entered
      ActiveWorkbook.SaveCopyAs vFilename
      tidyup:
      ChDrive sOldDrive
      ChDir sOldDir
      End Sub

    Viewing 2 reply threads
    Reply To: SAVE AS with help of text box (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: