View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
moon[_5_] moon[_5_] is offline
external usenet poster
 
Posts: 40
Default If then statement


Can you try to use the word 'Empty' instead of 'Null'?
So...

If .Cells.Value = Empty Then
blah
End If




"Catherine Jackson" schreef in
bericht ...
Hi,

I have a piece of code that looks at an Excel spreadsheet, copies the
cells
data, and puts it in another Excel sheet.

The first piece of data will always be there. But in some cases,
subsequent
fields may be blank. So I want to put in an If statement that says if
subsequent values are blank, just fill them in with the first value. Here
is
what I have:

testExpected = .Cells(currentRow, 6).Value
*******
If .Cells.Value is Null then
blah blah
End If
*******
Can someone help me with the code inside the asterisks please.