Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88868

Want to apply the code for sheet name 'Home' and 'Man' too

$
0
0
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

Viewing all articles
Browse latest Browse all 88868


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>