View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Test for empty cell

Try

If MyFile.Sheets(1).Cells(i, 4) = "" Then
r = -1
Else
r = MyFile.Sheets(1).Cells(i, 4)
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Sonnich" wrote in message
ups.com...
Hi!

I have a sheet, where I have a list of integers - if present -
the
field might be empty.
How do I detect whether it is empty?

Using
r = MyFile.Sheets(1).Cells(i, 4)
and later using r cuases problems, I'd like to set it to -1 in
cases
where it is empty.

I get the file from elswhere, the contest of it is unknown

BR
Sonnich