ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find an empty cell or null value (https://www.excelbanter.com/excel-programming/372658-find-empty-cell-null-value.html)

Janis

find an empty cell or null value
 
How do you find out if a cell is null? The datatype for that field is
integer. I want to test for a empty cell. I'm not sure if either one of
these is correct.
Thanks

If .Cells(iRow, 19).Value = ""

if .Cells(iRow, 19).Value isNull

Jim Thomlinson

find an empty cell or null value
 
This is probably your best bet

If Trim(.Cells(iRow, 19).Value) = ""

Just in case your cell has blank spaces in it...
--
HTH...

Jim Thomlinson


"Janis" wrote:

How do you find out if a cell is null? The datatype for that field is
integer. I want to test for a empty cell. I'm not sure if either one of
these is correct.
Thanks

If .Cells(iRow, 19).Value = ""

if .Cells(iRow, 19).Value isNull


Dave Peterson

find an empty cell or null value
 
if .cells(irow,19).value = "" then
will test to see if the cell is empty
or if the cell contains a formula that evaluates to ""
or if the cell contains a 0 length string (like just the apostrophe ('))

=if isempty(.cells(irow,19).value) then
will check to see if the cell is really empty--nothing at all in it.



Janis wrote:

How do you find out if a cell is null? The datatype for that field is
integer. I want to test for a empty cell. I'm not sure if either one of
these is correct.
Thanks

If .Cells(iRow, 19).Value = ""

if .Cells(iRow, 19).Value isNull


--

Dave Peterson


All times are GMT +1. The time now is 06:52 AM.

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