Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
My goal is to prevent the workbook from closing if there is not a value in Row 4, Column 4 when Row 4, Column 5 does have a value. This condition would apply for rows 4 to 454. I think I'm headed in the right direction, but I must be missing something... So far I have: Private Sub Workbook_BeforeClose(Cancel As Boolean) For i = 4 To 454 Set hours = Worksheets("Test").Cells(i, 5) Set task = Worksheets("Test").Cells(i, 4) If hours = 0 Then Cancel = False Else If task = 0 Then Cancel = True End If End If Next i End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prevent closing userform | Excel Programming | |||
Prevent closing userform | Excel Programming | |||
Prevent DialogBox closing | Excel Programming | |||
Prevent workbook closing... | Excel Programming | |||
API to prevent closing Excel | Excel Programming |