Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got this code in the BeforeSave event of my workbook:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If MsgBox("Have you researched and manually entered the correct" _ & vbNewLine & "amounts for Proceeds from" _ & " Sale of PPE?", vbYesNo, "Reminder") = vbYes Then ActiveWorkbbook.Save Else Sheets("Cash Flow").Select Range("B25").Select End If End Sub When I get my MsgBox and click YES, I get a run time error and the code stops on the ActiveWorkbook.Save line. If I click NO, the workbook saves, despite the fact I only want to go to a specific cell. How do I fix this code so when I click TES the workbook saves, and when I click NO it goes to the specified cell? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event (BeforeSave) - How to test VBA code? Dave P. can you hear me now? | Excel Discussion (Misc queries) | |||
BeforeSave event | Excel Discussion (Misc queries) | |||
BeforeSave sub won't save another workbook when triggered by another event sub | Excel Programming | |||
BeforeSave event | Excel Programming | |||
BeforeSave workbook event | Excel Programming |