Stop Workbook from closing.
Hi Melissa,
Try:
'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim rng As Range
Set rng = Me.Sheets("Sheet1").Range("A1:A100") '<<==== CHANGE
If Application.CountA(rng) < rng.Cells.Count Then
MsgBox "An entry is required in ALL cells in " _
& rng.Address(0, 0, , 1)
Cancel = True
End If
End Sub
'<<=============
---
Regards,
Norman
"beauty_bobaloo" wrote in message
...
thankyou soooo much. After all the stuffing around that I did, I can't
believe it is so simple!
To take this one step further, I would like to do the same thing if one
cell
in a particular range is empty.
ie range a1:a100
if there a values in cells 1 to 50 the let it close,
if there a values in cells 1 to 90 then let it close,
but if there is a blank gap somewhere in these cells with values, then
bring
up the poppup.
My mind is racing and you have helped me out tramendously, and I know I
can
figure the rest out . so I don't mind if you want to leave me to learn the
rest for myself,
but If it is simple enough for you, it would save me alot of time,
thanks again for your help
melissa
|