Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Excel 2000
|
#2
![]() |
|||
|
|||
![]()
You can set up your workbook so that it will not allow
the user to close the workbook without filling in certain cell. For example: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim checkRng As Range Set checkRng = Sheets("Sheet1").Range("A1") If checkRng.Value = "" Then Cancel = True MsgBox "Please fill in " & _ checkRng.Address(False, False) & "." End If End Sub --- Place this in the ThisWorkbook module of your workbook. HTH Jason Atlanta, GA -----Original Message----- Excel 2000 . |
#3
![]() |
|||
|
|||
![]()
Just a thought...
Maybe this would be better in the _beforeSave event. Then the user can open and close without having to fill in A1. And with the _beforeclose event, I can save with A1 empty, fill in A1, close (without saving). Jason Morin wrote: You can set up your workbook so that it will not allow the user to close the workbook without filling in certain cell. For example: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim checkRng As Range Set checkRng = Sheets("Sheet1").Range("A1") If checkRng.Value = "" Then Cancel = True MsgBox "Please fill in " & _ checkRng.Address(False, False) & "." End If End Sub --- Place this in the ThisWorkbook module of your workbook. HTH Jason Atlanta, GA -----Original Message----- Excel 2000 . -- Dave Peterson |
#4
![]() |
|||
|
|||
![]()
Yes, I wasn't sure which event made more sense. I suppose
if I had tested them both I would have reached the same conclusions. -----Original Message----- Just a thought... Maybe this would be better in the _beforeSave event. Then the user can open and close without having to fill in A1. And with the _beforeclose event, I can save with A1 empty, fill in A1, close (without saving). Jason Morin wrote: You can set up your workbook so that it will not allow the user to close the workbook without filling in certain cell. For example: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim checkRng As Range Set checkRng = Sheets("Sheet1").Range("A1") If checkRng.Value = "" Then Cancel = True MsgBox "Please fill in " & _ checkRng.Address(False, False) & "." End If End Sub --- Place this in the ThisWorkbook module of your workbook. HTH Jason Atlanta, GA -----Original Message----- Excel 2000 . -- Dave Peterson . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
make a cell empty based on condition | Charts and Charting in Excel | |||
Copy Word table into Excel cell by cell | Excel Discussion (Misc queries) | |||
Using Jet to read excel file returns blank for last cell - sometim | Excel Discussion (Misc queries) | |||
Paste rows of numbers from Word into single Excel cell | Excel Discussion (Misc queries) | |||
how do i set up a single cell continual entry in excel to total f. | Excel Discussion (Misc queries) |