Tina Norris Fields
tinanfields at torchlake.com
Tue Nov 18 07:51:46 CST 2003
Hi Borge, I ran into this when I was trying to automatically create a chart that would interpolate the values of an empty cell, rather than draw a sharp sawtooth. Here's what I found: if the function is evaluating the cell numerically, it sees an enpty cell as having the value of zero. What I ended up using was the following 'Copy only non-zero data from "onReadings" to "chartOnRead" Range("onReadings").Select ActiveCell.Select For x = 1 To Range("valToLookup").Count If ActiveCell.Value <> "" Then Selection.Copy ActiveCell.Offset(0, 4).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues ActiveCell.Offset(1, -4).Range("A1").Select Else: ActiveCell.Offset(1, 0).Range("A1").Select End If Next x Application.CutCopyMode = False The significant line is - If ActiveCell.Value <> "" Then HTH Tina Borge Steen Hansen wrote: >Hi, >anyone with a quick answer to this one: > >Excel appears to treat blank cell as zero > >I've created a function that tests the value in a cell (say A1) using Select >Case and delivers a value in another cell (say B1) depending on value in >cell. > >The function tests on values 0,1,2,3,4,5,6,7,8,9 and responds with a message >if any other value is entered. > >So far so good! > >Now, the annoying part is that a blank value - null - is treated as ZERO by >the function. > > >How do I turn this off - so that a the value of a blank cell is treated as >null ??? > >Regards > > >Borge, > > >_______________________________________________ >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com > > >