ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   0 considered as empty (https://www.excelbanter.com/excel-programming/351574-0-considered-empty.html)

filo666

0 considered as empty
 
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

Mark Lincoln

0 considered as empty
 
Change the If line to read:

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

That's all on one line.


Dave Peterson

0 considered as empty
 
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



filo666 wrote:

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


--

Dave Peterson

filo666

0 considered as empty
 
thanks Dave, it works just fine
sorry Mark but it didn't work well

"Dave Peterson" wrote:

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



filo666 wrote:

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


--

Dave Peterson



All times are GMT +1. The time now is 10:35 AM.

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