Hello
I´m trying to do this in VB:
If one (or any) cell in the range A1:A6 is not empty, then all range cells must be not empty.
If not, cancel save and show msg box.
Please help me.
Regards
Claudio.
Hello
I´m trying to do this in VB:
If one (or any) cell in the range A1:A6 is not empty, then all range cells must be not empty.
If not, cancel save and show msg box.
Please help me.
Regards
Claudio.
Please Login or Register to view this content.
If solved remember to mark Thread as solved
Hiu, patel45,
This macro must be part of Workbook_BeforeClose-event - please read all the post carefully.If not, cancel save and show msg box.
@loroverde:
adjust the name of the sheet to suit and place this code in ThisWorkbbok:
Ciao,Please Login or Register to view this content.
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
Hello
It works great as a macro, but i want to cancel before save if it doesn't accomplish the condition, I have used cancel=true but it doesn't work.
how can I do this.
Regards
claudio.
Hi. loroverde,
sorry about my guess for a wrong event - maybe use Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) in Thisworkbook instead:
Ciao,Please Login or Register to view this content.
Holger
Hello holger
It works fine, but how can i do If one (or any) cell in the range A1:F1 and the cell H1 are not empty, then all range cells must be not empty.
If not, cancel save and show msg box.
Regards
Claudio.
Hi, Claudio,
maybe like this:
Ciao,Please Login or Register to view this content.
Holger
Hello holger
How can i save this code with all the cells empty?
Because with all the cells empty i cant save the workbook
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks