ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   emtpy cell (https://www.excelbanter.com/excel-programming/337276-emtpy-cell.html)

lee

emtpy cell
 
I am new to programming and wonder if there is a way to check for a emty cell
( a cell that has the value of 0). I have a column B57:B76 I would like to
check if B57 has anything 0 if it does move to b58 and check if that is 0
and so on. When the program finds the first cell that is a emty cell, it then
used data on a other worksheet and the number in the last cell it checked for
the calculations to be placed in B77.

I think I could do it with if statements. I think it might be to long.

thanks for any help

Tom Ogilvy

emtpy cell
 
A cell containing 0 is not empty - but regardless, perhaps this will help:

Dim cell as Range
for each cell in Range("B57:B76")
if isempty(cell) then
msgbox cell.Address & " contains nothing"
exit for
elseif isnumeric(cell) then
if cell.Value = 0 then
msgbox "contains zero " & cell.address
exit for
end if
end if
Next

--
Regards,
Tom Ogilvy


"Lee" wrote in message
...
I am new to programming and wonder if there is a way to check for a emty

cell
( a cell that has the value of 0). I have a column B57:B76 I would like to
check if B57 has anything 0 if it does move to b58 and check if that is
0
and so on. When the program finds the first cell that is a emty cell, it

then
used data on a other worksheet and the number in the last cell it checked

for
the calculations to be placed in B77.

I think I could do it with if statements. I think it might be to long.

thanks for any help




Gary's Student

emtpy cell
 
VBA gives several options:

IsEmpty function can test for truely empty.
You can also check for an entered zero.
You can also check for the presence of a formula that is currenly yielding
zero.
--
Gary's Student


"Lee" wrote:

I am new to programming and wonder if there is a way to check for a emty cell
( a cell that has the value of 0). I have a column B57:B76 I would like to
check if B57 has anything 0 if it does move to b58 and check if that is 0
and so on. When the program finds the first cell that is a emty cell, it then
used data on a other worksheet and the number in the last cell it checked for
the calculations to be placed in B77.

I think I could do it with if statements. I think it might be to long.

thanks for any help



All times are GMT +1. The time now is 08:51 PM.

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