I was trying to have a macro run (that is already made) once the user closes out the data form. I was told that using the following code would get this marco to run when I closed out the form but the only time that I can get it to run is when I close out the sheet. Am I doing something wrong here or is there more to the story??
Private Sub workbook_BeforeClose(Cancel As Boolean)
Move 'this is my macro's name
End Sub
The code is in the "ThisWorkbook" object and the data form opens automatically when Excel opens.
Private Sub workbook_BeforeClose(Cancel As Boolean)
Move 'this is my macro's name
End Sub
The code is in the "ThisWorkbook" object and the data form opens automatically when Excel opens.