Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim rg1 As Range, rg2 As Range
Set rg1 = Sheets("Jersey").Range("E29:E49")
Set rg2 = Sheets("Jersey").Range("D52:D53")
If WorksheetFunction.CountA(rg1) > 0 And _
WorksheetFunction.CountA(rg2) = 0 Then
Cancel = True
MsgBox "Please input weight info"
End If
End Sub
↧
Want to apply the code for sheet name 'Home' and 'Man' too
↧