ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Preventing cell from being empty (https://www.excelbanter.com/excel-programming/327488-preventing-cell-being-empty.html)

Kobus

Preventing cell from being empty
 
Hi all
I have a few sheets in my workbook. On each sheet are a few cells that are
essential for calculations. I have managed to specify the range that the
values may have in these cells. But I want to check that the cell is not
empty when the cell loses focus. Is there a way of doing this with VBA (or
with the Excel functionality itself)?
Thanks

Harald Staff

Preventing cell from being empty
 
Hi

Select the cell(s), go Menu Data Validation. Choose the desired data type
in the Allow box (like Decimal between this and that value). Uncheck "ignore
blank". Finally customize the input and error message on the next panes.

HTH. Best wishes Harald

"Kobus" skrev i melding
...
Hi all
I have a few sheets in my workbook. On each sheet are a few cells that are
essential for calculations. I have managed to specify the range that the
values may have in these cells. But I want to check that the cell is not
empty when the cell loses focus. Is there a way of doing this with VBA (or
with the Excel functionality itself)?
Thanks




Patrick Molloy[_2_]

Preventing cell from being empty
 

you can use the sheet's CHANGE event. This is fired whenever an entry is
made. if the cell is empty, put a defaul into it

eg. I have a named range on another sheet called "defaultList" ...just two
cells for the example

You'll need a key in say the cell to the left of your entry cells so that
you can get the default from the default table looking up the key.









"Kobus" wrote:

Hi all
I have a few sheets in my workbook. On each sheet are a few cells that are
essential for calculations. I have managed to specify the range that the
values may have in these cells. But I want to check that the cell is not
empty when the cell loses focus. Is there a way of doing this with VBA (or
with the Excel functionality itself)?
Thanks



All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com