0 considered as empty

G

Guest

Hi, is there somehow tell VB that 0<>Empty??????
I have problems with this part of my code

blablabla
If Cells(aa, columna) = c Then
ssss = Cells(aa, columna).Address(False, False)
Set rngEndCell = Range(ssss)
columna = columna + 1
b = b + 1
GoTo siguiente2
End If
blalbalba

when c=0 but cells(aa,columna)=empty the programs goes inside the if structure

So I need to tell VB that 0 is different of Empty
How to accomplish this????
TIA
 
M

Mark Lincoln

Change the If line to read:

If (Cells(aa, columna) <> "") and (Cells(aa, columna) = c) Then

That's all on one line.
 
D

Dave Peterson

if isempty(yourcellhere) then
'do what you want with empty
else
if yourcellhere.value = 0 then
'not empty, but equal to 0.
end if
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top