Of the top of my head for the saves and close when subit is met, have all your code that might write to a sheet first then at the bottom so it reads it last you need something to call a sub, ie call force save then code off top of my head might be like
Public Sub Save_Survey(ForceSave)
Start:
Dim MySaveFile As String 'Used to switch between Survey and New File only
Dim FileName As String
MySaveTime = Format(Date, "yyyy-mm-dd")
'Set Default Initial FileName if required
If OpenSurveyFilename = vbNullString Then OpenSurveyFilename = "HPC_Survey_" & MySaveTime
'Save this Survey
If ForceSave = True Then
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=OpenSurveyFilename, FileFilter:="Excel Files (*.xls), *.xls", Title:="Forced save of Project: " & HPC_Main.PROJECT.Value)
Else
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=OpenSurveyFilename, FileFilter:="Excel Files (*.xls), *.xls", Title:="Save Project: " & HPC_Main.PROJECT.Value)
End If
If fileSaveName = False Then
'Check if this is a forced save
If ForceSave = True Then
Response = MsgBox("You must save your project before the data is finally submitted!", vbCritical)
GoTo Start
Else
GoTo Finish
End If
End If
this might give you an idea, but you call that sub in your submit click then the close would be an unload me etc after that
Bookmarks