save as issue

E

eyesonly1965

is there a possibillity that when i push the save button in my form that
i only save the sheet and not the form.

see below code:
-Private Sub cmdOpslaan_Click()

With ActiveWorkbook.Sheets("Gegevensblad")
'First part of filename...
a = Range("A4").Value & " - " & Range("B4").Value
'Filename extension...
c = ".xls"
s_filename = a + c
Dim fname As Variant
fname =
Application.GetSaveAsFilename(InitialFileName:=s_filename)
If fname = False Then
Debug.Print "user clicked cancel"
'do nothing
Else
Debug.Print "user chose " & fname
ActiveWorkbook.SaveAs Filename:=fname
End If
End With

End Sub-
 
B

bgeier

If your form is in the same workbook as the sheet you are saving, the
form is saved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top