Hello all,
I have tried to do a button with save as dialog box and autocomplete the file name based on a cell value. The cell value have also a path (C:\Users\user\Desktop\02.11.2020 - name). I tried more solutions but i couldn`t find a good one. The below code work partial. It give me the SaveAs dialog box and is also autocomplete like i want but if i press save, nothing is happened. The file is not saved. Could you give me an advise or a solution ?
Thank you very much!
I have tried to do a button with save as dialog box and autocomplete the file name based on a cell value. The cell value have also a path (C:\Users\user\Desktop\02.11.2020 - name). I tried more solutions but i couldn`t find a good one. The below code work partial. It give me the SaveAs dialog box and is also autocomplete like i want but if i press save, nothing is happened. The file is not saved. Could you give me an advise or a solution ?
Thank you very much!
Code:
Sub Copy_Fara_formule_1()
Dim i As Integer
Worksheets("LL").Range("A1:J178").Copy
Workbooks.Add
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormats
For i = 250 To 7 Step -1
If Cells(i, 6).Value = 0 Then Rows(i).Delete
Next i
Dim saveDialog As FileDialog
Set saveDialog = Application.FileDialog(msoFileDialogSaveAs)
With saveDialog
.InitialFileName = Range("D1").Value + ".xls"
.Show
End With
End Sub