Vba Activeworkbook Close Save. You could put a button or some other trigger on your worksheets to initiate the macro so that it's easier for your users to access the macro. SaveAs Remove the line owb.close if it is no longer open anyway.
However, when I run the code, there is no files. This should save them in seperate workbooks. Close Else Call Msgbox("changes not saved") End If.
Since we have already written the code to close the userform, we can see the existing code in VBA.
However when running the macro or stepping through this function call in DEBUG mode it still saves the file.
When you use VBA to activate another workbook, the ActiveWorkbook part in the VBA after that would start referring to the activated workbook. Userforms are vital while getting inputs from the user as part of the VBA project. The earlier part of the code actually.